Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Mar 4, 2024
1 parent 328fe04 commit c0feba0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions classes/QueryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public function __construct() {
add_action( 'pre_get_posts', [ $this, 'pre_get_posts_custom_orderby' ] );

add_filter( 'posts_clauses', [ $this, 'posts_clauses' ], 10, 2 );

add_filter( 'rest_orbis_project_query', [ $this, 'rest_query' ], 10, 2 );
}

/**
Expand Down Expand Up @@ -186,4 +188,18 @@ public function posts_clauses( $pieces, $query ) {

return $pieces;
}

/**
* REST query.
*
* @link https://developer.wordpress.org/reference/hooks/rest_this-post_type_query/
* @param array $args Query arguments.
* @param WP_REST_Request $request WordPress REST request.
* @return array
*/
public function rest_query( $args, $request ) {
$args['orbis_project_is_finished'] = false;

return $args;
}
}

0 comments on commit c0feba0

Please sign in to comment.