Add match day filter to events admin

This commit is contained in:
Brian Miyaji
2017-11-15 23:02:35 +11:00
parent 84297941dc
commit aae1f374a0
2 changed files with 13 additions and 0 deletions

View File

@@ -45,6 +45,11 @@
float: right;
}
.sp-tablenav-input {
height: 28px;
margin: 0 4px 0 0;
}
#sp_videodiv .inside > fieldset > p:first-child {
margin-top: 7px !important;
}

View File

@@ -278,6 +278,9 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
);
sp_dropdown_taxonomies( $args );
$selected = isset( $_REQUEST['match_day'] ) ? $_REQUEST['match_day'] : null;
echo '<input name="match_day" type="text" class="sp-tablenav-input" placeholder="' . __( 'Match Day', 'sportspress' ) . '" value="' . $selected . '">';
if ( current_user_can( 'edit_others_sp_events' ) )
wp_nonce_field( 'sp-save-inline-results', 'sp-inline-nonce', false );
}
@@ -296,6 +299,11 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
$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';
}
}
}
}