mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 18:05:45 +03:00
Update contributor count key name
This commit is contained in:
parent
ad234eb045
commit
55e832c052
1 changed files with 4 additions and 2 deletions
|
@ -143,10 +143,12 @@ function filter_query( $query ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$contributor_count_key = META_PREFIX . 'pledge-confirmed-contributors';
|
||||||
|
|
||||||
// Set up meta queries to include the "valid pledge" check, added to both search and any pledge requests.
|
// Set up meta queries to include the "valid pledge" check, added to both search and any pledge requests.
|
||||||
$meta_queries = (array) $query->get( 'meta_query' );
|
$meta_queries = (array) $query->get( 'meta_query' );
|
||||||
$meta_queries[] = array(
|
$meta_queries[] = array(
|
||||||
'key' => META_PREFIX . 'org-number-employees',
|
'key' => $contributor_count_key,
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'compare' => '>',
|
'compare' => '>',
|
||||||
'type' => 'NUMERIC',
|
'type' => 'NUMERIC',
|
||||||
|
@ -172,7 +174,7 @@ function filter_query( $query ) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'contributors':
|
case 'contributors':
|
||||||
$query->set( 'meta_key', META_PREFIX . 'org-number-employees' );
|
$query->set( 'meta_key', $contributor_count_key );
|
||||||
$query->set( 'orderby', 'meta_value_num' );
|
$query->set( 'orderby', 'meta_value_num' );
|
||||||
$query->set( 'order', 'DESC' );
|
$query->set( 'order', 'DESC' );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue