In this bit of code:
$field = get_field_object('field_51d3f9c3f5554');
$field['choices']
will contain an array of the available choices for that field, not the currently selected value, $field['value']
contains the currently selected value.
However, using get_field_object
when all you want is the currently selected value is unnecessary.
for the correct use of get_field()
, read the documentation carefully to learn what you must pass to that function, specifically the $post_id examples
section. taxonomy terms are not the same as posts, you have to pass an additional argument in the form of "$taxonomy_$term_id"
.
EDIT- also note, in your call to get_field(' select_to_display_')
, you have a space before the key name, which will fail unless the key is actually prefixed with a space, which I presume is not the case.
Related Posts:
- Advanced Custom Fields displaying on tag pages
- Redirect to another page using contact form 7? [closed]
- Unable to check if plugin is active
- Plugin to restrict non-admin user to existing tags
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- Using Advanced Custom Fields with WordPress and Lightbox
- How to store ACF custom fields data in a custom table
- Generate Advanced Custom Fields box in custom admin menu page
- Edit Imported advanced Custom Fields from wordpress Dashboard
- How to add terms to a post depending on its title?
- Visual Composer vs. Advanced Custom Fields [closed]
- ACF for audio url in wordpress audio shortcode
- Custom field in TWIG template – Advanced custom fields plugin
- Advanced Custom Fields query
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- How to create Repeater fields using Advanced Custom Fields?
- Mixed unrelated taxonomy in permalink
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- Using ACF to display data on all pages
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- Last modified field for user profile?
- WP_Query ordering numbers as letters
- Get post by ASC from custome field DATE picker
- Getting value from Advanced Custom Fields [closed]
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Inserting HTML tag with ACF into shortcode
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- Pull out Advanced Custom Fields in Related post plugin
- Using a post-signup hook to get user details
- Matching Chapters to a Custom posts [closed]
- Custom Fields with Pods not being translated
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- How do I get fresh post data in post_publish hook?
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- add custom filters to the event calendar plugin programatically to frontend [closed]
- How to Display Taxonomy Custom Meta Box Data in Archive Page?
- Enable users to change change and add taxonomies of posts
- Can you use another Profile Builder shortcodes through advanced custom fields
- How to set taxonomy in custom plugin?
- Individual testimonial taxonomy not displaying (white screen)
- dirname( __FILE__) returning wrong directory inside plugin
- How do I apply style to each category of a list?
- ACF: post query, hide duplicate values [closed]
- Paid Membership Pro with ACF [closed]
- ACF only showing up in Homepage but doesn’t appears in all pages
- How to check if a taxonomy not exists in a plugin
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- Using ACF default value to autoincrement a number field
- URLs Added to ACF Repeater Field are not working
- Advanced Custom Fields – Get value in other plugin file [closed]
- Slashes stripped in ACF
- Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?
- Remove Advanced Custom Fields plugin for client?
- Adding class to last list item? Not WP generated
- Keeping and updating ACF and ACF Pro at the same time
- I receive taxonomy id
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- ACF – How to set the menu order for the relationship field
- Conditional custom redirect
- Preview with Custom Post Type Not Working
- How to display a number of posts based on a Advanced Custom Field (ACF)
- Translation to ACF relationship field
- Advanced custom fields and Slideshow gallery desn’t work together? [closed]
- Categories from front-end, checkbox selection doesn’t work
- Advanced Custom Fields Plugin – Images not displaying
- How to create repeater field manually, without plugin (ACF Pro)?
- How to validate custom fields in Quick edit/bulk edit?
- how to create hierachial taxonomy and manage under single post type?
- What snippet do I need to type to show my ACF field show up on my theme?
- Replace the_content with ACF Flexible Content via function
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- acf backend error handling
- Setting Author on CPT
- Can’t load the the canges of field groups [duplicate]
- Visual composer custom element error
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- ACF checkbox return format based on page
- custom fields not displaying on wordpress site
- ACF Fields are not showing up on Homepage
- Why Custom fields description is not working WordPress Version 5.4.2?
- Images are broken in Wysiwyg Editor – ACF backend
- make p tag collapsed after 3 rows
- How do I change the functionality of an image slider which is part of ACF?
- Change the color of ACF Subtitle output background
- Can I retain custom taxonomy data when uninstalling a third-party plugin that created it?
- Will downloading a page builder plugin delete my existing data?
- Exclude Tag Links from and Text
- Add Custom Field to Post Pages via Plugin
- Returning incorrect $post->ID after installing plugin
- ACF Query result in a new td (echo)
- Get only selected custom taxonomy
- ACF Taxonomy search on backend (Relationship field)
- Get a Taxonomy values in an array
- Else If statement for ACF [closed]
- Custom SportsPress list
- How can I display a list of only categories which are marked as ‘featured’ in the backend?
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- Related post based on 2 categories