ACF is actually doing what it should – storing a numerical array of selected values. If you want the label you can levy get_field_object
, which returns information about the custom field (rather than the value of it for the given post).
$field_obj = get_field_object( 'nav_widget_platforms' );
$platforms = get_field( 'nav_widget_platforms' );
foreach ( $platforms as $platform ){
echo $field_obj['choices'][ $platform ] . ": $platform<br />";
}
Related Posts:
- Can an array be used as a meta_query value?
- How to write PHP array to render JSON-LD Markup for Job Postings, with ACF
- How can I add multiple ‘tax_query’ arrays via a loop?
- Changing a specific value inside a complex repeater/flexible content field (ACF)
- Redirect to another page using contact form 7? [closed]
- Advanced Custom Fields – display label and value only if value entered
- Check for image with same filename but different extension
- Conditional multidimensional arrays and array_map
- Trying to select 1 item from an array
- How can you query posts by advance custom field when the value is a serialized array? [closed]
- ACF – Get ID of relationship field in flexible content
- Help using an array in ‘exclude’ key of another array
- Convert number to date format within an array
- Make sticky post with FacetWP
- Display a single row from nested array of custom field data
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Array sorting by custom field date
- Getting “Invalid argument supplied for foreach()” Warning
- Using ACF custom field for custom post type to order categories
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Array_splice index problem in ACF Flexible Content
- ACF relationship field outputting unpublished content [closed]
- Download PDF after CF7 form submission
- Use ACF select field to add a class to div inside a flexible content layout [closed]
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Add first letter of titles to array, then compare arrays
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- How to array only one key from another array
- Hide ACF from source code until a “show” button is clicked
- Filtering a function’ output for a new continued function
- Get image data from advanced custom field [closed]
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- Output meta into arrays
- Pull info from Soundcloud embed into a custom field?
- How do I turn these values from MYSQL into an array
- How to disable field on Advanced Custom Fields? [closed]
- Get html data with javascript to php array and store to wordpress database
- ACF: Querying relationship fields with Author
- ACF Relationship – Limit to specific pages
- Show only the future event (Advanced Custom Fields)
- Website goes down while importing backup (Internal server 500)
- Can’t get “has_sub_field()” to work in a conditional [closed]
- How do I create a numbered list with PHP? [closed]
- Outputing Post Object title as a div class with ACF
- Advanced Custom Fields if else issue
- If/Else Statement for Advanced Custom Fields
- Display total unique custon field results
- Advanced custom fields – pulling data in from another page
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to create a multidimensional array with multiple loops
- How to use array in function to get only value I want
- How to get both image attachment ID and url
- Error while setting role
- Get categories names as an array to use it in theme settings
- Upload non-featured image to image field
- Function wp_enqueue_style was called incorrectly
- ACF: If field contain a specific value, update value in another field programatically
- Search and replace not working for ACF Images
- Can you make a custom gutenberg block that allows the gutenberg editor within it?
- How to get the last category name of a child category?
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Any idea how to get something like this to work? [closed]
- Warning: in_array() null given in PHP function
- how to load random related posts with specific custom fields?
- HTML Special Characters in URL string [closed]
- Add original validation rule to Advance Custom Fields
- ACF put a comma after the last repeater field value [closed]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- how make file upload field through custom field
- How Do I Use a ACF Custom Field To Add A Slider ID?
- ACF – Pick first or second value from comma separated values
- Foreach loop inside an array_merge
- Override not echoing my string or dom element
- Form search query – displaying ACF “Post Object” field as results
- ACF Clone Field – Set Default Value
- InnerBlocks with allowedBlocks not working with acf_register_block
- ACF relationship fields ‘The results could not be loaded’
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- Loop over Array and get the distinct ids
- ACF save json to custom directory not working, default acf-json used instead
- Create short URL with auto 301 redirect
- Can I set up a hover animation in CSS depending on a PHP conditional?
- How to access or parse key/values that have “string”
- If Array Values Match Another Array’s Values, Then
- Get ACF options field in PHP acting as CSS
- Remove empty terms from array, sort alphabetically, update back to repeating field
- How to get ACF value inside Gutenberg Block from another page or template? I’m using Timber too
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- ACF Repeater Pagination stopped working since upgrade to php7.2
- How can I count ACF sub_field with a certain value
- ACF URL behavior, duplicating links
- Advanced Custom Fields oembed only outputs YouTube URL
- ACF Maps admin error: “For development purposes only” even after supplying api key
- How can I get all values from my array in a loop in php? [closed]
- Query entries from custom post type in an ACF flexible content field