Home › Forums › Add-ons › Repeater Field › Order repeatable field by date in back-end › Reply To: Order repeatable field by date in back-end
Hi Federico!
I was on a holiday so late reply here.
Can you be more specific, do you have example code?
Anyway, the code I used in my functions.php was:
/**
* Hooks the WP cpt_post_types filter
*
* @param array $post_types An array of post type names that the templates be used by
* @return array The array of post type names that the templates be used by
**/
function my_cpt_post_types( $post_types ) {
$post_types[] = 'beugel';
$post_types[] = 'kingweg';
$post_types[] = 'groep_8';
return $post_types;
}
add_filter( 'cpt_post_types', 'my_cpt_post_types' );
function my_taxonomy_query( $args, $field, $post_id ) {
// modify args
$args['orderby'] = 'count';
$args['order'] = 'ASC';
// return
return $args;
}
add_filter('acf/fields/taxonomy/query', 'my_taxonomy_query', 10, 3);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.