Twenty Fourteen: Adjust capability queries when using version before WordPress 5.9-alpha.

As capability queries was introduced in 5.9, this commit allows for previous versions by assigning the "who" and unsetting "capability". 

Follow-up to [51943].

Props johnbillion, swissspidy.
Fixes #16841.
Built from https://develop.svn.wordpress.org/trunk@52290


git-svn-id: http://core.svn.wordpress.org/trunk@51882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-11-30 19:25:01 +00:00
parent 576116927b
commit 68537a8eed
2 changed files with 7 additions and 1 deletions

View File

@ -498,6 +498,12 @@ if ( ! function_exists( 'twentyfourteen_list_authors' ) ) :
'capability' => array( 'edit_posts' ),
);
// Capability queries were only introduced in WP 5.9.
if ( version_compare( $GLOBALS['wp_version'], '5.9-alpha', '<' ) ) {
$args['who'] = 'authors';
unset( $args['capability'] );
}
/**
* Filters query arguments for listing authors.
*

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52289';
$wp_version = '5.9-alpha-52290';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.