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
- WP_Query not using relation key as expected and not producing any results
- WP Query filtering by custom category not showing all relevant posts
- Can’t query tag and post_type at the same time
- shortcode to show custom post types by category
- Unable to retrieve any posts of CPT in wp-admin
- Update menu when saving settings
- Pagination on a custom post type loop
- Sorting Custom Post Type by Meta Value but wont display when set to 0
- showing custom post types of a certain category only
- How to alter WP-JSON main query or best practise for custom endpoints
- WP_Query orderby modified to include custom meta changes
- Function to display custom post type on front page makes menu items dissapear
- WordPress custom loop filter by meta_key and value with serialize data
- query private custom post type
- Display custom post type from dynamic custom field
- custom post type not showing in menu
- Query/list all terms and their custom post count
- Linking to the most recent post in a Custom Post Type
- How to make sure content doesn’t display if selection is empty
- Filtering WP_Query Dynamically on the Front-End
- Show one item per category of a custom post type
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Query custom post type with tags
- Correct classes for WordPress menu items
- convert custom query to wp_query
- Wrong request query on cpt and tax
- Custom Taxonomy Navigation, with current menu items for children?
- Previous/Next Link by Meta Value in CPT
- Show custom post type filtered by category
- Randomize Posts. Skip the first post in ascending order
- Customize the Dashboard Menu Editor
- Creating a navigation menu of all posts of a custom post type and their children posts?
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Display posts from Custom Post Type in category page on front-end