Combine request filter dropdowns and remove unused arguments

This commit is contained in:
Takumi
2013-07-26 15:11:37 +10:00
parent 45b09f2089
commit efd804222f
8 changed files with 72 additions and 434 deletions

View File

@@ -23,7 +23,7 @@ function sp_team_meta_init() {
add_meta_box( 'postimagediv', __( 'Logo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_team', 'side', 'high' );
}
function sp_team_edit_columns($columns) {
function sp_team_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'sp_icon' => '&nbsp;',
@@ -35,44 +35,4 @@ function sp_team_edit_columns($columns) {
return $columns;
}
add_filter( 'manage_edit-sp_team_columns', 'sp_team_edit_columns' );
function sp_team_request_filter_dropdowns() {
global $typenow, $wp_query;
if ( $typenow == 'sp_team' ) {
// Leagues
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
$args = array(
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
'taxonomy' => 'sp_league',
'name' => 'sp_league',
'selected' => $selected
);
sp_dropdown_taxonomies( $args );
echo PHP_EOL;
// Seasons
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
$args = array(
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
'taxonomy' => 'sp_season',
'name' => 'sp_season',
'selected' => $selected
);
sp_dropdown_taxonomies( $args );
echo PHP_EOL;
// Sponsors
$selected = isset( $_REQUEST['sp_sponsor'] ) ? $_REQUEST['sp_sponsor'] : null;
$args = array(
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Sponsors', 'sportspress' ) ),
'taxonomy' => 'sp_sponsor',
'name' => 'sp_sponsor',
'selected' => $selected
);
sp_dropdown_taxonomies( $args );
}
}
add_action( 'restrict_manage_posts', 'sp_team_request_filter_dropdowns' );
?>