Add classes and filters to team dropdown

This commit is contained in:
Brian Miyaji
2015-09-23 21:39:45 +10:00
parent 56a3af544b
commit b5ee62610e
4 changed files with 11 additions and 7 deletions

View File

@@ -54,7 +54,7 @@ jQuery(document).ready(function($){
});
// Tab filter
$(".sp-tab-panel").siblings(".sp-tab-select").find("select").change(function() {
$(".sp-tab-filter-panel").siblings(".sp-tab-select").find("select").change(function() {
var val = $(this).val();
var filter = ".sp-filter-"+val;
var $filters = $(this).closest(".sp-tab-select").siblings(".sp-tab-select");
@@ -86,7 +86,7 @@ jQuery(document).ready(function($){
});
// Trigger tab filter
$(".sp-tab-panel").siblings(".sp-tab-select").find("select").change();
$(".sp-tab-filter-panel").siblings(".sp-tab-select").find("select").change();
// Dropdown filter
$(".sp-dropdown-target").siblings(".sp-dropdown-filter").find("select").change(function() {

View File

@@ -33,7 +33,7 @@ class SP_Meta_Box_Event_Details {
<?php
foreach ( $taxonomies as $taxonomy ) {
if ( 'sp_venue' == $taxonomy ) continue;
sp_taxonomy_field( $taxonomy, $post, true );
sp_taxonomy_field( $taxonomy, $post, true, true );
}
?>
<div class="sp-event-sp_venue-field">

View File

@@ -71,7 +71,10 @@ class SP_Meta_Box_Event_Teams {
</ul>
<?php
foreach ( $tabs as $index => $post_type ) {
sp_post_checklist( $post->ID, $post_type, ( 0 == $index ? 'block' : 'none' ), array( 'sp_league', 'sp_season', 'sp_current_team' ), $i );
do_action( 'sportspress_event_teams_meta_box_checklist', $post->ID, $post_type, ( 0 == $index ? 'block' : 'none' ), $team, $i );
if ( apply_filters( 'sportspress_event_teams_meta_box_default_checklist', true ) ) {
sp_post_checklist( $post->ID, $post_type, ( 0 == $index ? 'block' : 'none' ), array( 'sp_league', 'sp_season', 'sp_current_team' ), $i );
}
}
?>
<?php } ?>
@@ -96,6 +99,7 @@ class SP_Meta_Box_Event_Teams {
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
endif;
}
wp_nonce_field( 'sp-get-players', 'sp-get-players-nonce', false );
}
/**

View File

@@ -783,7 +783,7 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
if ( ! isset( $post_id ) )
global $post_id;
?>
<div id="<?php echo $meta; ?>-all" class="posttypediv wp-tab-panel sp-tab-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
<div id="<?php echo $meta; ?>-all" class="posttypediv wp-tab-panel sp-tab-panel sp-tab-filter-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
<input type="hidden" value="0" name="<?php echo $meta; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
<ul class="categorychecklist form-no-clear">
<li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
@@ -1201,7 +1201,7 @@ if ( !function_exists( 'sp_get_next_event' ) ) {
}
if ( !function_exists( 'sp_taxonomy_field' ) ) {
function sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false ) {
function sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false, $trigger = false ) {
$obj = get_taxonomy( $taxonomy );
if ( $obj ) {
$post_type = get_post_type( $post );
@@ -1222,7 +1222,7 @@ if ( !function_exists( 'sp_taxonomy_field' ) ) {
'name' => 'tax_input[' . $taxonomy . '][]',
'selected' => $term_ids,
'values' => 'term_id',
'class' => 'sp-has-dummy widefat',
'class' => 'sp-has-dummy widefat' . ( $trigger ? ' sp-ajax-trigger' : '' ),
'chosen' => true,
'placeholder' => __( 'All', 'sportspress' ),
);