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:
- Getting custom taxonomy from custom post type
- how to get posts by custom post type then display Custom fields?
- How to sort a table of custom posts by column containing custom field
- Use Custom Post Type as Custom Field
- Insert slider (Custom Post Type) into pages
- get terms that have post with custom post type between 2 values
- Archive filter disappears on no results?
- Linking three taxonomies with ACF
- WordPress custom post type archive with description
- How to replace custom post type slug with an ACF value?
- Link users to a custom post type
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Validate custom fields before save using WordPress Rest API
- get_posts of Custom Post Type AND Custom Taxonomy
- How can I dynamically add a post to a custom post type which uses a custom field?
- Problem with WordPress query on page using custom fields
- the_content() not outputting anything (Advanced Custom Fields)
- custom post type WYSIWG removes paragraphs when displayed
- ACF From & To Date Validations
- Exclude objects from WordPress API based from ACF field using rest_prepare_{$post_type}
- CPT archive admin menu label
- Rewrite Rule for showing Parent/Child Relationship between Two Hierarchical Custom Post Types
- Retrieve custom field from Contact Form 7 [closed]
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- How to update post meta on uploaded image from a custom form?
- Multiple Frontend Filters Using Advanced Custom Fields
- Order post by date with ACF
- Displaying custom field according to date
- How to set the seo title tag on a page by page basis?
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- Sort a custom post with ACF: Date Picker & Display Featured!
- Post loop count is not in order
- How to inherit field value from parent post into in child / sub post
- Custom Post Type page sorts differently on different environments
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custome fields not displayed
- Create short URL with auto 301 redirect
- Why is wp api returning old acf values?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- get custom post type value in header.php [closed]
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- Group by custom field value (start and end times)
- Custom post types, disable fields
- wp-includes does not contain a feed template
- Using WP meta query to show custom post types by a start and finish date
- Excerpt length: get first paragraph
- How to display author details in a custom post type in the wordpress backend?
- Fetch data from two custom post types and create multidimensional array for output to html table
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- Query filter by value in meta_value array
- count & sum the value of custom field of the author post in dynamic posts
- Orderby custom fields is not working
- Custom post ID & display information related to this ID
- Expire post to draft by date-picker custom field
- Display a Custom Post Type with Advanced Custom Fields on Homepage
- Filter result of Custom Post Type using meta_query with ACF
- Same custom post type with different ACF
- Custom sorting in post columns by ACF Pro Select Field
- WP_Query not using custom taxonomy categories on custom post type
- How would i insert a value of custom field from Advaced Custom Field into shortcode generated by Gravity Forms [closed]
- Auto generate excerpt from ACF field on a CPT that does not support excerpt or content
- Subpages URLs for Custom Post Type
- Custom post type not pulling CSS
- Button link display in shortcodes using custom field in ACF
- How do I link to a dynamic ACF button from a Custom Post type?
- How to show link to product in custom fields?
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Create 3 Levels of relations with WordPress
- In the admin, how can you list thumbnails instead of titles for a custom post type?
- Looping through image object using ACF and CPT UI [SOLVED]
- Linking posts together with Advanced Custom Fields “both ways”
- WordPress page not showing up – replaced with last 10 posts?
- Custom permalink rewrite rules – how do I fix this?
- Custom Field as Custom Post type element class
- Extracting Post ID and passing through as an attribute in a shortcode
- 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?
- Automatically convert standard posts with custom fields to custom post types
- Showing custom post user wise with different color in wordpress
- Submit and edit font end custom post type
- How to make a custom search template for custom taxonomy?
- Making my custom column sortable
- Filter Content on all Post Types
- Get month and day from a Date Picker custom field
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Modifying and Displaying URL’s in a Post Template using parse_url
- Custom post type adding additional markup
- Advanced Custom Fields: query posts filtered by multiple field values
- WooCommerce – Complete Order when an action occurs
- WordPress Loop trouble with ACF [closed]
- 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?
- Advanced Custom Fields Custom Post Types Heirarchy
- ACF Custom post type name changing issue