Ho trovato il coniglio (I found the rabbit)! This sorts and synchronizes frontend and backwend (post edit view).
function my_acf_load_value( $value, $post_id, $field ) {
// vars
$order = array();
// bail early if no value
if( empty($value) ) {
return $value;
}
// populate order
foreach( $value as $i => $row ) {
$order[ $i ] = $row['field_606af7xxxxxx']; // Ersetzen Sie 'field_XXXXX' durch den tatsächlichen Schlüssel des 'regie'-Feldes.
}
// multisort
array_multisort( $order, SORT_ASC, $value ); // Ändern Sie SORT_DESC in SORT_ASC, wenn Sie aufsteigend sortieren möchten.
// return
return $value;
}
add_filter('acf/load_value/name=bestfilm', 'my_acf_load_value', 10, 3); // Ändern Sie 'scores' in 'bestfilm'.
Related Posts:
- Filter by custom field in custom post type on admin page
- Filtering a WP_Query meta_query by numeric values isn’t working
- Populate a ACF Select Dropdown from Custom Post Type
- Filter a custom field based on selection of another custom field (ACF) [closed]
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Count custom post types with a specific meta value
- How to set custom post type as post title to avoid ‘Auto Draft’
- Display posts if a custom field value is equal to another custom field value
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- “add_post_type_support” with Custom Post Type & ACF
- ACF simple text field value not showing
- Post Object Filter by Custom Field, not title (ACF)
- Rewrite WordPress URL to show CPT meta field data
- Display multiple custom post types and sort them chronological by one of their fields
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Custom fields vs. Custom post types for a Portfolio Website
- How to add a post slug to a url?
- Add custom ID to CPT posts only create not update
- ACF Field on CPT Slug
- WP_Query order by custom field, then randomly order some of results
- Custom Post Type + ACF and performance [closed]
- Meta Query Not Returning Output Despite Having Matching Values
- How to render a custom post type template with custom fields using shortcode
- How to query WordPress posts bycustom field with a max characters’ length
- The loop seems stuck to a single (now deleted) post
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- Specific routing for CPT
- Displaying custom field according to date
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Advanced custom field boolean value in custom post type
- Why would social icon badges disappear after adding a custom post type?
- Sort a custom post with ACF: Date Picker & Display Featured!
- ACF repeater field usage
- List of users that clicked a ‘Join’ button at single post
- set_query_params using custom params defined in functions file?
- Create short URL with auto 301 redirect
- How to define the template for custom posts?
- Batch Extract Date from post title and put into ACF custom field
- Query entries from custom post type in an ACF flexible content field
- Why is wp api returning old acf values?
- get custom post type value in header.php [closed]
- How to export custom post type with ACF to individual file with automation?
- ACF Relationship Posts how to show additional content
- Limit search field to just search a custom post type with custom fields
- Excerpt length: get first paragraph
- Custom field with Types: get custom field’s value label (of type select)
- Show posts associated with ACF post object and custom post type
- How can i show ACF in post excerpts
- 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
- Orderby custom fields is not working
- CPT email notification including only new value custom fields
- Filter result of Custom Post Type using meta_query with ACF
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Custom sorting in post columns by ACF Pro Select Field
- Load info from customposttype into template page
- Subpages URLs for Custom Post Type
- 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
- Videos Post Type with Custom Filters
- 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
- Use output of wp_dropdown_categories($args)
- CPT: execute code after load if parameter is set
- Looping through image object using ACF and CPT UI [SOLVED]
- ACF Post Content Not Being Searched
- Values show up in custom home page but not in custom post pages
- Display related post content and custom field content
- WordPress page not showing up – replaced with last 10 posts?
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- 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
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Advanced Custom Fields – Add Field to Specific Page [closed]
- $post breaking container loop
- Collection of fields in a single post
- 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
- Elementor Custom Query to get Posts by ACF (Post Object Field
- Create WP multisites as a custom post type
- WordPress WP_Query Sort by 2 dates – custom fields
- Two custom post type relations
- selecting custom post types and taxonomies for hub page listing blocks
- Made a Custom Post Type using ACF. Via the dashboard I cannot see the view button to see the post
- Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- Custom fields disappearing when a custom post type is assigned