Title: ACF type changes
Last modified: July 18, 2018

---

# ACF type changes

 *  Resolved [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/)
 * Hi !
    I’m French so I apologize if my English is not perfect 😉 In fact, I am
   using your plugin for my website and I set up some type for my ACF items and 
   your plugin is changing it. For example, I have an ACF called Conferences with
   a couple of items, as usual it have a name, the author (so me !), a type and 
   the date of publication. But in the json file, the type is no longer “Tuesday”
   for example but “Conferences”. I’ve searched in every endpoints possible I can’t
   find my type. I don’t know if it is clear but could you help me please ?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/acf-type-changes/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/acf-type-changes/page/2/?output_format=md)

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10504968)
 * Bonjour [@gabi971](https://wordpress.org/support/users/gabi971/),
 * I’m not sure what you mean…
 * Which endpoint are you accessing? For example, in my test environment I use a
   Custom Post Type called “yks_ee_events” that I’ve renamed “Events” and I hit 
   the endpoint [http://yikes.test/wp-json/wp/v2/events](http://yikes.test/wp-json/wp/v2/events).
 * This CPT has custom fields defined by ACF that look like this in the admin: [https://imgur.com/a/4DIyY78](https://imgur.com/a/4DIyY78)
 * When I hit this endpoint, I see my fields like this: [https://imgur.com/a/gGouTsG](https://imgur.com/a/gGouTsG)
 * Also, please review this ticket to see if it helps at all: [https://wordpress.org/support/topic/acf-meta-callback-null/](https://wordpress.org/support/topic/acf-meta-callback-null/).
 * Hope that helps.
 * Cheers,
    Kevin.
 * P.S. Congratulations on the World Cup 🙂
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505014)
 * Hmmmm how can I put this…
    I use a Custom Post Type call “Conferences” that I
   can reach with the endpoint …/conference. But I’d like to know if it is possible
   to reach something which is not in the field like the field type right here :
   [https://imgur.com/nmVQ8Ce](https://imgur.com/nmVQ8Ce). Thanks for your quick
   answer.
 * P.S Thank you 😀
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505030)
 * Can you show me how you have set up your fields on our plugin’s page?
 * A screenshot like this: [https://imgur.com/M3VA7m3](https://imgur.com/M3VA7m3)
 * Feel free to obfuscate certain items if you feel the data is sensitive.
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505036)
 * It looks like this [https://imgur.com/LE2YHal](https://imgur.com/LE2YHal)
    That’s
   all I have.
    -  This reply was modified 7 years, 10 months ago by [gabi971](https://wordpress.org/support/users/gabi971/).
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505082)
 * So you’re trying to add fields(?) from the post Human Increased to the Conference
   Endpoint?
 * What type of post is Human Increased supposed to be? Is it supposed to be a Conference
   Post?
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505111)
 * Yes it is a Conference Post and all the information like the date or the author
   are present on the json page. I also have the field “type” but it’s no longer“
   Tuesday October 16th”, it’s “conference”.
    I don’t understand why
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505135)
 * Is “Type” a custom field?
 * I think that the reason your admin area is showing “Type” as “Tuesday October
   16th” is because you’re using some type of filter that is _displaying_ the data
   differently. The post type is still stored as “Conference” in the database but
   there must be custom code that is displaying a different field (e.g. Tuesday)
   for the “Type” column.
 * Another possible explanation is that whatever you defined as “Type” is being 
   overwritten by WordPress’ Post Type.
 * Can you try renaming your “Type” field? Or perhaps creating a new field that 
   stores the Type column?
 * Does that make sense?
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505175)
 * Yeah that makes sense. I think I should create a new field for the Type column.
   That’s too bad, I’m just an intern I’ll have to ask ahaha.
    I’ll try this tomorrow
   and tell you it it’s okay !
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10505184)
 * Okay!
 * It’s also worth noting that I don’t see the Type field in the list of custom 
   fields our plugin gathered (your screenshot – [https://imgur.com/LE2YHal](https://imgur.com/LE2YHal)).
 * So I don’t know where this Type field is coming from. If it’s a custom field,
   it should show in that list. (And you should be able to rename it so it doesn’t
   conflict with WordPress’ standard Type field).
 * Let me know what you find out tomorrow!
 * Cheers,
    Kevin.
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511589)
 * Hello it’s me again ! Before I try anything useless, I find out what I was looking
   for.
    It’s called taxonomies, some kind of keywords ? Do you know if there is
   a way to get them ? It’s not at the /wp/v2/taxonomies endpoints
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511884)
 * Hello! Welcome Back!
 * Taxonomies are _not_ controllable by our plugin and I don’t think they’re easily
   accessible (by default) through the REST API. This means you’ll need to add custom
   code in order to add taxonomies to your endpoints.
 * Here is a simple class that shows how to add all of the terms for a certain taxonomy(`'
   taxonomy_name'`) to a CPT’s (`cpt_slug`) endpoint.
 *     ```
       /**
       * Add taxonomies to the REST API
       */
       class Customize_REST_API {
   
       	public function __construct() {
   
       		// Add taxonomies to our REST API
       		add_action( 'rest_api_init', array( $this, 'add_taxonomies_to_rest_api' ) );
       	}
   
       	public function add_taxonomies_to_rest_api() {
   
       		register_rest_field( 
       			'CPT_SLUG', // CPT slug
       			'KEY', // this needs to match meta key - this is what will show up as the key in the REST API
       			array(
       				'get_callback'    => array( $this, 'get_taxonomy' ),
       				'update_callback' => null,
       				'schema'          => null,
       			)
       		);		
       	}
   
       	public function get_taxonomy( $object, $field_name, $request ) {
   
       		// $object['id'] is your CPT's post ID
       		// 'TAXONOMY_SLUG' should be the slug of your taxonomy
       		return wp_get_post_terms( $object['id'], 'TAXONOMY_SLUG' );
       	}
       }
   
       new Customize_REST_API();
       ```
   
 * Cheers,
    Kevin.
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511894)
 * Thanks ! Am I supposed to create a file with this code ? Or just add it somewhere
   specifically ?
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511914)
 * Well, I don’t know how your site is setup but the easiest way to do it would 
   be to create a file from this code and then require it in your `functions.php`
   file. The best thing to do would be to add it to your site’s child theme if you’re
   using one. Alternatively, you could create an MU plugin out of it.
 *  Thread Starter [gabi971](https://wordpress.org/support/users/gabi971/)
 * (@gabi971)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511938)
 * I think I already saw that code somewhere… and they were talking about the functions.
   php file too ! But when I looked for it, I found multiple files with the same
   name…
    One in wp-include and one in my theme folder… so if I understand well 
   the best thing to do would be to add it in the functions.php file of my site’s
   theme folder ? Is that it ?
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/#post-10511968)
 * Yes – the functions.php file in your _theme_. It’s not the best way to add it
   but it will work.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/acf-type-changes/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/acf-type-changes/page/2/?output_format=md)

The topic ‘ACF type changes’ is closed to new replies.

 * ![](https://ps.w.org/wp-rest-api-controller/assets/icon-256x256.png?rev=2489942)
 * [WP REST API Controller](https://wordpress.org/plugins/wp-rest-api-controller/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-rest-api-controller/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-rest-api-controller/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-rest-api-controller/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-rest-api-controller/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [gabi971](https://wordpress.org/support/users/gabi971/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/acf-type-changes/page/2/#post-10512039)
 * Status: resolved