Just so you know, and after much code sniffing, I finally have a working solution :
First, the custom field may start with wpcf-
(for example: wpcf-custom-field
). This prefix may be ignored and only the remaining characters kept. As in
$customField = substr($fieldName, 5); // $fieldName="wpcf-custom-field";
Now, the custom field data may be fetch via the function wpcf_admin_fields_get_field
which is located in the Types plugin directory under includes/fields.php
. For example :
$fieldConfig = wpcf_admin_fields_get_field($customField);
Among other things, the options may be collected with this code :
$fieldOptions = array();
if (isset($fieldConfig['data']['options'])) {
foreach ($fieldConfig['data']['options'] as $option) {
$fieldOptions[$option['title']] = $option['value'];
}
}
Which, if the custom field is a type select, will return an array like
array(
'1' => 'Option A',
'2' => 'Option B',
'3' => 'Option C'
);
Related Posts:
- Media library – Limit images to custom post type
- ACF Relationships in Custom Post Type Permalink
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Query by 2 values of a repeater ACF field
- Show ACF field from custom taxonomy and display on the single template
- Display posts if a custom field value is equal to another custom field value
- Get Custom Field Values by Another Custom Field in WordPress
- Show custom field from custom taxanomy term on custom post type
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- Custom Post type with ACF in REST API, how do I get those values?
- Custom Post Types not showing, custom WP_Query
- Rewrite WordPress URL to show CPT meta field data
- Create 3 Level Relations with ACF and WordPress
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Retrieve value of a category’s custom field
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- Bulk Update Custom Fields for Custom Post Types
- Cluster CPT posts to users based on ACF value from their profile on dashboard
- ACF Values Don’t Show After Import Unless I Edit/Update Post
- Stuck in Order by more then one
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- Query Custom Post Type Taxonomy term with multiple parameters
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- How to group posts and get a mixed posts and groups view?
- Integrate Custom Post Type Events into Calendar
- Specific routing for CPT
- WebP Fallback for Inline Background Image in Style Attribute
- Query based on custom fields start and end date
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Why is my WP Query not returning first result’s post meta?
- Recoverable Fatal Error – Object of class WP_Post could not be converted to string
- How to get a custom type post data when it has a connection with another custom type post?
- List of users that clicked a ‘Join’ button at single post
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- set_query_params using custom params defined in functions file?
- ACF for custom post type archive pages: which hook to use?
- How to define the template for custom posts?
- Query entries from custom post type in an ACF flexible content field
- Distribute Custom Post in different pages
- How do I replace the post title with a custom field?
- Advanced custom fields Post Object image field not displaying in custom post type single.php
- Sum and count of custom field values
- How to export custom post type with ACF to individual file with automation?
- Custom Post Type with Configurable Sidebar via ACF
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- Limit search field to just search a custom post type with custom fields
- SQL query – get ids – Advanced Custom Fields / WPeC
- Show posts associated with ACF post object and custom post type
- Create if else for post types in WP_Query ‘post__in’ values
- Grouping custom wordpress post types by acf value
- Set Post Private if no linked Post Objects (ACF)
- Show in an entry a Custom Post Type associated to a post
- Using ACF values in nested WP queries for CPT with date values in the past
- Create/populate Custom Posts ACF fields from external JSON file
- WordPress URL rewrites using Advanced Custom Field
- Custom Post Type and Structure Question
- CPT email notification including only new value custom fields
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Load info from customposttype into template page
- Display Custom Field or Custom Taxonomy in front page /post/product
- Why do my custom post types stop displaying over time?
- How to access repeater field of a custom field?
- ACF Pro Accessing fields on a Custom Post Type
- Modify Publish Metabox location on CPT
- Some posts not displaying by taxonomy term
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Save_post acf data not updating category of post type
- Display Specific Posts at Start of Loop
- How to display custom post type pagination buttons when processing AJAX request
- Adding specific custom fields (images) to post excerpt
- filter using custom fields
- Display custom tax in “while” loop
- CPT: execute code after load if parameter is set
- ACF Post Content Not Being Searched
- Fixed custom fields depending on posttype/category
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Grouping and paging CPT events by month with custom field date
- Custom post tag images not displaying with ACF
- $post breaking container loop
- Get post id of permalink for a specific custom post type?
- Collection of fields in a single post
- If you’re calling a dynamic css inline style does that div have to be in the loop?
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Copying custom field value in to title
- How to show animal lineage/pedigree in WordPress?
- Custom Post Type Loop breaking php
- Styling first post using Advanced Custom Fields
- ACF Relationship: Group posts by parent category term, then child [closed]
- ACF Field to set Publish Date – Post Duplication upon Update
- Getting ACF relationship field information
- using a template for more then 1 page
- Retrieve a post with its ACF repeater fields in wordpress
- How to I add count of custom posts listed in a post as a prefix to its title
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Why custom search engine only searches in post titles of custom posts?
- Display ACF object field data using Elementor Custom Query
- Post object GUID adding http:/