Merge branch 'master' into patch-19
This commit is contained in:
@@ -479,7 +479,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Importers
|
||||
* @version 2.5
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Importers
|
||||
* @version 2.6.9
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Post_Types
|
||||
* @version 2.6.5
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -44,6 +44,9 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
// Filtering
|
||||
add_action( 'restrict_manage_posts', array( $this, 'filters' ) );
|
||||
add_filter( 'parse_query', array( $this, 'filters_query' ) );
|
||||
|
||||
// Post states
|
||||
add_filter( 'display_post_states', array( $this, 'post_states' ), 10, 2 );
|
||||
|
||||
// Call SP_Admin_CPT constructor
|
||||
parent::__construct();
|
||||
@@ -294,27 +297,47 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
wp_nonce_field( 'sp-save-inline-results', 'sp-inline-nonce', false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter in admin based on options
|
||||
*
|
||||
* @param mixed $query
|
||||
*/
|
||||
public function filters_query( $query ) {
|
||||
global $typenow, $wp_query;
|
||||
/**
|
||||
* Filter in admin based on options
|
||||
*
|
||||
* @param mixed $query
|
||||
*/
|
||||
public function filters_query( $query ) {
|
||||
global $typenow, $wp_query;
|
||||
|
||||
if ( $typenow == 'sp_event' ) {
|
||||
if ( $typenow == 'sp_event' ) {
|
||||
|
||||
if ( ! empty( $_GET['team'] ) ) {
|
||||
$query->query_vars['meta_value'] = $_GET['team'];
|
||||
$query->query_vars['meta_key'] = 'sp_team';
|
||||
}
|
||||
if ( ! empty( $_GET['team'] ) ) {
|
||||
$query->query_vars['meta_value'] = $_GET['team'];
|
||||
$query->query_vars['meta_key'] = 'sp_team';
|
||||
}
|
||||
|
||||
if ( ! empty( $_GET['match_day'] ) ) {
|
||||
$query->query_vars['meta_value'] = $_GET['match_day'];
|
||||
$query->query_vars['meta_key'] = 'sp_day';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ! empty( $_GET['match_day'] ) ) {
|
||||
$query->query_vars['meta_value'] = $_GET['match_day'];
|
||||
$query->query_vars['meta_key'] = 'sp_day';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace displayed post state for events
|
||||
*
|
||||
* @param array $post_states
|
||||
* @param object $post
|
||||
*/
|
||||
public function post_states( $post_states, $post ) {
|
||||
$status = get_post_meta( $post->ID, 'sp_status', true );
|
||||
|
||||
if ( 'postponed' == $status ) {
|
||||
$post_states = array( __( 'Postponed', 'sportspress' ) );
|
||||
} elseif ( 'cancelled' == $status ) {
|
||||
$post_states = array( __( 'Canceled', 'sportspress' ) );
|
||||
} elseif ( 'tbd' == $status ) {
|
||||
$post_states = array( __( 'TBD', 'sportspress' ) );
|
||||
}
|
||||
|
||||
return $post_states;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Meta_Boxes
|
||||
* @version 2.5.5
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 2.6
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
* AJAX Event Handler
|
||||
*
|
||||
* @class SP_AJAX
|
||||
* @version 2.6.15
|
||||
* @version 2.7
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* The SportsPress league table class handles individual league table data.
|
||||
*
|
||||
* @class SP_League_Table
|
||||
* @version 2.6.15
|
||||
* @version 2.7
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* The SportsPress player list class handles individual player list data.
|
||||
*
|
||||
* @class SP_Player_List
|
||||
* @version 2.6.19
|
||||
* @version 2.7
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* The SportsPress player class handles individual player data.
|
||||
*
|
||||
* @class SP_Player
|
||||
* @version 2.6.19
|
||||
* @version 2.7
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
|
||||
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
* Registers post types and taxonomies
|
||||
*
|
||||
* @class SP_Post_types
|
||||
* @version 2.6.13
|
||||
* @version 2.7
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Core
|
||||
* @package SportsPress/Functions
|
||||
* @version 2.6.6
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Core
|
||||
* @package SportsPress/Functions
|
||||
* @version 2.6.19
|
||||
* @version 2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
Reference in New Issue
Block a user