Add filters for registering taxonomies and update individual mode
This commit is contained in:
@@ -52,10 +52,12 @@ class SP_Meta_Box_List_Data {
|
||||
<?php echo 'number' == $orderby ? '#' : __( 'Rank', 'sportspress' ); ?>
|
||||
</label></th>
|
||||
<th><?php _e( 'Player', 'sportspress' ); ?></th>
|
||||
<?php if ( apply_filters( 'sportspress_has_teams', true ) ) { ?>
|
||||
<th><label for="sp_columns_team">
|
||||
<input type="checkbox" name="sp_columns[]" value="team" id="sp_columns_team" <?php checked( ! is_array( $columns ) || array_key_exists( 'team', $columns ) ); ?>>
|
||||
<?php _e( 'Team', 'sportspress' ); ?>
|
||||
</label></th>
|
||||
<?php } ?>
|
||||
<?php foreach ( $columns as $key => $label ): ?>
|
||||
<?php if ( in_array( $key, array( 'number', 'team' ) ) ) continue; ?>
|
||||
<th><label for="sp_columns_<?php echo $key; ?>">
|
||||
@@ -100,6 +102,7 @@ class SP_Meta_Box_List_Data {
|
||||
<a class="button button-primary sp-save"><?php _e( 'Save', 'sportspress' ); ?></a>
|
||||
</span>
|
||||
</td>
|
||||
<?php if ( apply_filters( 'sportspress_has_teams', true ) ) { ?>
|
||||
<td>
|
||||
<?php
|
||||
$selected = sp_array_value( $player_stats, 'team', get_post_meta( get_the_ID(), 'sp_team', true ) );
|
||||
@@ -115,6 +118,7 @@ class SP_Meta_Box_List_Data {
|
||||
wp_dropdown_pages( $args );
|
||||
?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<?php foreach( $columns as $column => $label ):
|
||||
if ( in_array( $column, array( 'number', 'team' ) ) ) continue;
|
||||
$value = sp_array_value( $player_stats, $column, '' );
|
||||
@@ -129,7 +133,7 @@ class SP_Meta_Box_List_Data {
|
||||
else:
|
||||
?>
|
||||
<tr class="sp-row alternate">
|
||||
<td colspan="<?php $colspan = sizeof( $columns ) + 3; echo $colspan; ?>">
|
||||
<td colspan="<?php $colspan = sizeof( $columns ) + ( apply_filters( 'sportspress_has_teams', true ) ? 3 : 2 ); echo $colspan; ?>">
|
||||
<?php printf( __( 'Select %s', 'sportspress' ), __( 'Data', 'sportspress' ) ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -32,6 +32,7 @@ class SP_Post_types {
|
||||
public static function register_taxonomies() {
|
||||
do_action( 'sportspress_register_taxonomy' );
|
||||
|
||||
if ( apply_filters( 'sportspress_has_leagues', true ) ):
|
||||
$labels = array(
|
||||
'name' => __( 'Competitions', 'sportspress' ),
|
||||
'singular_name' => __( 'Competition', 'sportspress' ),
|
||||
@@ -60,7 +61,9 @@ class SP_Post_types {
|
||||
foreach ( $object_types as $object_type ):
|
||||
register_taxonomy_for_object_type( 'sp_league', $object_type );
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ( apply_filters( 'sportspress_has_seasons', true ) ):
|
||||
$labels = array(
|
||||
'name' => __( 'Seasons', 'sportspress' ),
|
||||
'singular_name' => __( 'Season', 'sportspress' ),
|
||||
@@ -89,7 +92,9 @@ class SP_Post_types {
|
||||
foreach ( $object_types as $object_type ):
|
||||
register_taxonomy_for_object_type( 'sp_season', $object_type );
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ( apply_filters( 'sportspress_has_venues', true ) ):
|
||||
$labels = array(
|
||||
'name' => __( 'Venues', 'sportspress' ),
|
||||
'singular_name' => __( 'Venue', 'sportspress' ),
|
||||
@@ -118,7 +123,9 @@ class SP_Post_types {
|
||||
foreach ( $object_types as $object_type ):
|
||||
register_taxonomy_for_object_type( 'sp_venue', $object_type );
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ( apply_filters( 'sportspress_has_positions', true ) ):
|
||||
$labels = array(
|
||||
'name' => __( 'Positions', 'sportspress' ),
|
||||
'singular_name' => __( 'Position', 'sportspress' ),
|
||||
@@ -147,7 +154,9 @@ class SP_Post_types {
|
||||
foreach ( $object_types as $object_type ):
|
||||
register_taxonomy_for_object_type( 'sp_position', $object_type );
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ( apply_filters( 'sportspress_has_roles', true ) ):
|
||||
$labels = array(
|
||||
'name' => __( 'Jobs', 'sportspress' ),
|
||||
'singular_name' => __( 'Job', 'sportspress' ),
|
||||
@@ -176,6 +185,7 @@ class SP_Post_types {
|
||||
foreach ( $object_types as $object_type ):
|
||||
register_taxonomy_for_object_type( 'sp_role', $object_type );
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
do_action( 'sportspress_after_register_taxonomy' );
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ class SportsPress_Individual_Mode {
|
||||
add_filter( 'sportspress_staff_teams', '__return_false' );
|
||||
add_filter( 'sportspress_list_team_selector', '__return_false' );
|
||||
add_filter( 'option_sportspress_event_split_players_by_team', '__return_false' );
|
||||
add_filter( 'sportspress_has_teams', '__return_false' );
|
||||
|
||||
// Remove templates
|
||||
//remove_action( 'sportspress_single_event_content', 'sportspress_output_event_performance', 50 );
|
||||
|
||||
Reference in New Issue
Block a user