WP_Query tax query part of slug

You can use below code to search in taxonomy. First using name__like in get_terms it will return all terms ids which have $keyword then that ids use in wp_query. $termIds = get_terms([ ‘name__like’ => $keyword, ‘fields’ => ‘ids’ ]); $args = [ ‘post_type’ => ‘movies’, ‘tax_query’ => [ [ ‘taxonomy’ => ‘actors’, ‘field’ => ‘id’, … Read more

Bypass “supress_filters” in WP Query

Looking at the WP_Query Class you should be able to use pre_get_posts to modify the query before any other filters are run, which includes turning off the suppress_filters flag. An example of this could be: /** * Modify WP_Queries * @link https://wordpress.stackexchange.com/q/356950/7355 * * @param WP_Query $query * * @return void */ function wpse356950_query_modifications( $query … Read more

How to display user order by role

i dont know how to achieve this in query arg. This is because it cannot be done using just arguments. No option for role is listed in the order/orderby parameter docs. There is no option to sort by user role in WordPress. Instead, you’re going to have to query for all gold role users, grab … Read more