Load league table and player list option in teams

This commit is contained in:
Brian Miyaji
2016-04-08 15:28:31 +10:00
parent 808ef62fdb
commit ef57de9eab
3 changed files with 34 additions and 12 deletions

View File

@@ -146,18 +146,6 @@ class SP_Templates {
'action' => 'sportspress_output_team_staff',
'default' => 'yes',
),
'lists' => array(
'title' => __( 'Player Lists', 'sportspress' ),
'option' => 'sportspress_team_show_lists',
'action' => 'sportspress_output_team_lists',
'default' => 'yes',
),
'tables' => array(
'title' => __( 'League Tables', 'sportspress' ),
'option' => 'sportspress_team_show_tables',
'action' => 'sportspress_output_team_tables',
'default' => 'yes',
),
) )
),
'table' => array_merge(

View File

@@ -39,6 +39,7 @@ class SportsPress_League_Tables {
add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );
add_filter( 'sportspress_team_settings', array( $this, 'add_settings' ) );
add_filter( 'sportspress_team_options', array( $this, 'add_options' ) );
add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 30 );
}
/**
@@ -260,6 +261,22 @@ class SportsPress_League_Tables {
)
);
}
/**
* Add team template.
*
* @return array
*/
public function add_team_template( $templates ) {
return array_merge( $templates, array(
'tables' => array(
'title' => __( 'League Tables', 'sportspress' ),
'option' => 'sportspress_team_show_tables',
'action' => 'sportspress_output_team_tables',
'default' => 'yes',
),
) );
}
}
endif;

View File

@@ -38,6 +38,7 @@ class SportsPress_Player_Lists {
add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );
add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );
add_filter( 'sportspress_player_settings', array( $this, 'add_settings' ) );
add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 20 );
}
/**
@@ -249,6 +250,22 @@ class SportsPress_Player_Lists {
)
) );
}
/**
* Add team template.
*
* @return array
*/
public function add_team_template( $templates ) {
return array_merge( $templates, array(
'lists' => array(
'title' => __( 'Player Lists', 'sportspress' ),
'option' => 'sportspress_team_show_lists',
'action' => 'sportspress_output_team_lists',
'default' => 'yes',
),
) );
}
}
endif;