Show newest chapters on top in ACF relationship
This commit is contained in:
parent
5107c7fc0d
commit
0cab2324f6
@ -81,12 +81,19 @@ if ( ! class_exists('acf') && is_admin() ) {
|
||||
*/
|
||||
|
||||
function fictioneer_acf_filter_chapters( $args, $field, $post_id ) {
|
||||
$args[ 'meta_query' ] = array(
|
||||
// Limit to chapters set to this story
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'fictioneer_chapter_story',
|
||||
'value' => $post_id
|
||||
)
|
||||
);
|
||||
|
||||
// Order by date, descending, to see the newest on top
|
||||
$args['orderby'] = 'date';
|
||||
$args['order'] = 'desc';
|
||||
|
||||
// Return
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user