Wishlist Member: Sorting the posts by membership levels
…The post object to check. * * @return boolean True if post is on the specific level. */ function rlv_free_filter( $post ) { $free_posts = rlv_generate_level_post_list( 1313127748 ); return isset( $free_posts[ $post->ID ] ); } /** * Comparison function for array_udiff: post objects are considered * equal if they have……level posts and uses that check whether a post is on that list or not. The function that gets the list of post IDs will do that once, and will then just return the list on later calls. /** * Generates the list of posts for the specific membership level….…} if ( empty( $rlv_wishlist_level_posts[ $level ] ) ) { $results = wlmapi_get_level_posts( $level ); $rlv_wishlist_level_posts[ $level ] = array_fill_keys( array_column( $results[‘posts’][‘post‘], ‘ID’ ), true ); } return $rlv_wishlist_level_posts[ $level ]; } /** * Filter function that returns true if posts is on the specific level. * * @param WP_Post…