pass argument to job listing query
-
I’d like to pass some filter to the listing query, but I can’t get my function to work with the “job_manager_get_listing” hook, this is my code:
function filter_hide( $query_args ) { $meta = get_user_meta(get_current_user_id(), 'hide', true); if(!is_admin() ) { $args = array( 'author__not_in' => $meta, ); } return $query_args; } add_action( 'pre_get_posts', 'filter_hide', 10, 2 ); add_action('job_manager_get_listings', 'filter_hide');
The id of authors to hide is stored in a user meta array with single key and multiple values.
The “author__not_in” value is standard on the wp_query arguments
Please let me know
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘pass argument to job listing query’ is closed to new replies.