Add tab labels to templates
This commit is contained in:
@@ -69,8 +69,11 @@ class SP_Template_Loader {
|
|||||||
// Get layout setting
|
// Get layout setting
|
||||||
$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
|
$layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
|
||||||
|
|
||||||
|
// Get templates
|
||||||
|
$templates = SP()->templates->$type;
|
||||||
|
|
||||||
// Combine layout setting with available templates
|
// Combine layout setting with available templates
|
||||||
$templates = array_merge( array_flip( $layout ), SP()->templates->$type );
|
$templates = array_merge( array_flip( $layout ), $templates );
|
||||||
|
|
||||||
$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
|
$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
|
||||||
|
|
||||||
@@ -134,8 +137,11 @@ class SP_Template_Loader {
|
|||||||
// Continue if tab content is empty
|
// Continue if tab content is empty
|
||||||
if ( empty( $buffer ) ) continue;
|
if ( empty( $buffer ) ) continue;
|
||||||
|
|
||||||
|
// Get template label
|
||||||
|
$label = sp_array_value( $template, 'label', $template['title'] );
|
||||||
|
|
||||||
// Add to tabs
|
// Add to tabs
|
||||||
$tabs .= '<li class="sp-tab-menu-item' . ( 0 === $i ? ' sp-tab-menu-item-active' : '' ) . '"><a href="#sp-tab-content-' . $key . '" data-sp-tab="' . $key . '">' . apply_filters( 'gettext', $template['title'], $template['title'], 'sportspress' ) . '</a></li>';
|
$tabs .= '<li class="sp-tab-menu-item' . ( 0 === $i ? ' sp-tab-menu-item-active' : '' ) . '"><a href="#sp-tab-content-' . $key . '" data-sp-tab="' . $key . '">' . apply_filters( 'gettext', $label, $label, 'sportspress' ) . '</a></li>';
|
||||||
|
|
||||||
// Render the template
|
// Render the template
|
||||||
$tab_content .= '<div class="sp-tab-content sp-tab-content-' . $key . '" id="sp-tab-content-' . $key . '"' . ( 0 === $i ? ' style="display: block;"' : '' ) . '>' . $buffer . '</div>';
|
$tab_content .= '<div class="sp-tab-content sp-tab-content-' . $key . '" id="sp-tab-content-' . $key . '"' . ( 0 === $i ? ' style="display: block;"' : '' ) . '>' . $buffer . '</div>';
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class SP_Templates {
|
|||||||
apply_filters( 'sportspress_after_team_template', array(
|
apply_filters( 'sportspress_after_team_template', array(
|
||||||
'link' => array(
|
'link' => array(
|
||||||
'title' => __( 'Visit Site', 'sportspress' ),
|
'title' => __( 'Visit Site', 'sportspress' ),
|
||||||
|
'label' => __( 'Link', 'sportspress' ),
|
||||||
'option' => 'sportspress_team_show_link',
|
'option' => 'sportspress_team_show_link',
|
||||||
'action' => 'sportspress_output_team_link',
|
'action' => 'sportspress_output_team_link',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
@@ -173,6 +174,7 @@ class SP_Templates {
|
|||||||
apply_filters( 'sportspress_before_player_template', array(
|
apply_filters( 'sportspress_before_player_template', array(
|
||||||
'selector' => array(
|
'selector' => array(
|
||||||
'title' => __( 'Dropdown', 'sportspress' ),
|
'title' => __( 'Dropdown', 'sportspress' ),
|
||||||
|
'label' => __( 'Players', 'sportspress' ),
|
||||||
'option' => 'sportspress_player_show_selector',
|
'option' => 'sportspress_player_show_selector',
|
||||||
'action' => 'sportspress_output_player_selector',
|
'action' => 'sportspress_output_player_selector',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
@@ -240,6 +242,7 @@ class SP_Templates {
|
|||||||
apply_filters( 'sportspress_before_staff_template', array(
|
apply_filters( 'sportspress_before_staff_template', array(
|
||||||
'selector' => array(
|
'selector' => array(
|
||||||
'title' => __( 'Dropdown', 'sportspress' ),
|
'title' => __( 'Dropdown', 'sportspress' ),
|
||||||
|
'label' => __( 'Staff', 'sportspress' ),
|
||||||
'option' => 'sportspress_staff_show_selector',
|
'option' => 'sportspress_staff_show_selector',
|
||||||
'action' => 'sportspress_output_staff_selector',
|
'action' => 'sportspress_output_staff_selector',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ class SportsPress_League_Tables {
|
|||||||
return array_merge( $templates, array(
|
return array_merge( $templates, array(
|
||||||
'tables' => array(
|
'tables' => array(
|
||||||
'title' => __( 'League Tables', 'sportspress' ),
|
'title' => __( 'League Tables', 'sportspress' ),
|
||||||
|
'label' => __( 'League Table', 'sportspress' ),
|
||||||
'option' => 'sportspress_team_show_tables',
|
'option' => 'sportspress_team_show_tables',
|
||||||
'action' => 'sportspress_output_team_tables',
|
'action' => 'sportspress_output_team_tables',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ class SportsPress_Player_Lists {
|
|||||||
return array_merge( $templates, array(
|
return array_merge( $templates, array(
|
||||||
'lists' => array(
|
'lists' => array(
|
||||||
'title' => __( 'Player Lists', 'sportspress' ),
|
'title' => __( 'Player Lists', 'sportspress' ),
|
||||||
|
'label' => __( 'Players', 'sportspress' ),
|
||||||
'option' => 'sportspress_team_show_lists',
|
'option' => 'sportspress_team_show_lists',
|
||||||
'action' => 'sportspress_output_team_lists',
|
'action' => 'sportspress_output_team_lists',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
Reference in New Issue
Block a user