Omit player performance with equation or text format from player statistics
This commit is contained in:
@@ -121,10 +121,16 @@ class SP_Meta_Box_Equation {
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'equation',
|
||||
'compare' => '!=',
|
||||
'value' => 'number',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => array( 'equation', 'text' ),
|
||||
'compare' => 'NOT IN',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -158,6 +158,12 @@ class SP_Meta_Box_Event_Performance {
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'number',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'equation',
|
||||
|
||||
@@ -436,7 +436,20 @@ class SP_Player_List extends SP_Custom_Post {
|
||||
'numberposts' => -1,
|
||||
'posts_per_page' => -1,
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC'
|
||||
'order' => 'ASC',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'number',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => array( 'equation', 'text' ),
|
||||
'compare' => 'NOT IN',
|
||||
),
|
||||
),
|
||||
);
|
||||
$stats = get_posts( $args );
|
||||
|
||||
|
||||
@@ -125,6 +125,19 @@ class SP_Player extends SP_Custom_Post {
|
||||
'posts_per_page' => 100,
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'number',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => array( 'equation', 'text' ),
|
||||
'compare' => 'NOT IN',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$posts = get_posts( $args );
|
||||
|
||||
@@ -936,7 +936,26 @@ if ( !function_exists( 'sp_column_checklist' ) ) {
|
||||
<?php
|
||||
$posts = get_pages( array( 'post_type' => $meta, 'number' => 0 ) );
|
||||
if ( empty( $posts ) ):
|
||||
$query = array( 'post_type' => $meta, 'numberposts' => -1, 'post_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order' );
|
||||
$query = array(
|
||||
'post_type' => $meta,
|
||||
'numberposts' => -1,
|
||||
'post_per_page' => -1,
|
||||
'order' => 'ASC',
|
||||
'orderby' => 'menu_order',
|
||||
'meta_query' => array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => 'number',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
array(
|
||||
'key' => 'sp_format',
|
||||
'value' => array( 'equation', 'text' ),
|
||||
'compare' => 'NOT IN',
|
||||
),
|
||||
),
|
||||
);
|
||||
$posts = get_posts( $query );
|
||||
endif;
|
||||
if ( sizeof( $posts ) ):
|
||||
|
||||
Reference in New Issue
Block a user