So i got it working, by adding a filter:
i added this before the wp_list_pages
add_filter( 'get_pages', 'check_propper_rank', 10, 2 );
wp_list_pages( array(
'post_type' => 'wiki-term',
) );
and then created a new filter, to removed the ones that did’nt fit the rank.
function check_propper_rank( $pages, $arguments ) {
$user_rank = 100;
foreach ( $pages as $key => $page ) {
$required_rank = get_post_meta($page->ID, 'rank', true);
if ( $required_rank >= $user_rank ) {
unset($pages[$key]);
}
}
if ( empty( $pages ) )
return $pages;
// Remove instantly
remove_filter( current_filter(), __FUNCTION__, 10 );
return $pages;
}
Related Posts:
- Mixing regular and custom post types (with meta_query) on home page
- WP_Query() show posts that end later than today
- WP_Query orderby custom field then post_date in one query
- Filtering a WP_Query meta_query by numeric values isn’t working
- Highlighting current item of custom post types’ sub pages, listed by wp_list_pages
- Using Query Posts With Multiple Post Types And A Taxonomy
- Can’t sort order of wp_query with 2 meta keys
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Combine tax_query and meta_query in WP_Query
- query order by date on custom type: wrong order
- exclude custom post type by meta key in wp_query
- Filter posts with meta_query NOT IN where value has multiple values
- How do I create an archive page for standard posts?
- Filtering by Post Meta Custom Fields – Performance
- Is it possible to apply a meta_query to one specific post type in a query with multilple post types?
- Setting proper query for multiple custom admin filters
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How to do WP_Query with two meta fields with orderby clause
- Stuck in Order by more then one
- Why is this query not working? (Standard posts + custom post type)
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Possible to filter custom post type with multiple meta data?
- Query based on custom fields start and end date
- WP_query – Filter by tax_query and meta_query using multiple select
- Getting a custom post’s custom field based on another custom post’s custom field select
- find custom post type post by searching its custom field with my string
- WP_Query of custom post type sorted by meta_key has unexpected results
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Query Posts, order by meta value
- WP_Meta_Query object with conditionals
- Sorting by meta_key different to search criteria?
- Using WP meta query to show custom post types by a start and finish date
- Two queries – one with checkbox ticked, one without – comparing meta_query
- How to order query results based on if a custom field has been populated, then the order by the date of the post?
- meta query condition don’t work
- Custom query result empty on page 2
- Use WP_query to match post types based on custom field values
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- post type => ‘any’ not applied my custom queries
- How to get the posts that my following users are liked?
- Meta_Query refuses to return results
- Not able to get my custom search result using meta_query and tax_query together?
- Querying, storing, and using data from 2 separate custom post types
- Query events post type after current date and timezone
- Conditional posts in WP_query for search
- Selecting posts older than the current Unix epoch timestamp
- Custom Query With Multiple Meta Key Value
- Trying to combine multiple WordPress queries
- Querying meta values within an array
- current_page_item and custom post type?
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Order Wp Query by earliest of 3 dates meta query
- WP_Query() displaying past post / event
- WP Query Conditionally query meta and taxonomy
- Query by post title
- How to check if a WP_Query has data
- Now can I group custom post types together?
- Number of pages – multiple (custom) post types
- Retrieving 3 latest post from each of 5 different custom post types
- Get latest 4 post on a custom post filtered by category
- Wp-query causing problems with the_content();
- wp_query and comment_parent – select only posts with top level comments
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Ordering Custom Post Types with WP_Query
- Custom query variable – get wordpress to redirect to nice permalink url
- Why are navigation items saved in the database?
- is_main_query() not working for WP REST API
- Loop through Custom Post Type, and then show children within each iteration
- Unable to retrieve any posts of CPT in wp-admin
- forming WP_Query for posts of all post types but from specific categories
- How can I get the number of custom post type posts that have a specific attachment image set?
- Including metaboxes from custom post types in global search — continued
- WP Query ‘posts_per_page’
- How to Query in WordPress which shows Alphabetic Posts?
- postsperpage value not being applied
- Create query for both custom post type and category
- Getting titles from an array of IDs
- Post Type => Any conundrum
- Pagination Not Working When Used With WP_Query() `offset` Property
- How to select meta key in custom database query
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Make pagination work as a carousel (custom query)
- WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
- Search result based on URL
- Loop with Custom Post Type and Taxonomies
- New WP_Query not isolating custom post types on front-page template
- Events with multiple event dates + permalink for each date
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- Pagination not working on homepage
- How to query custom post then display sections by meta value
- Assign a tag to custom post type using a query
- Query order by a numeric ACF field
- Meta_query question