Move text settings to dedicated tab
This commit is contained in:
@@ -34,6 +34,7 @@ class SP_Admin_Settings {
|
||||
$settings[] = include( 'settings/class-sp-settings-events.php' );
|
||||
$settings[] = include( 'settings/class-sp-settings-teams.php' );
|
||||
$settings[] = include( 'settings/class-sp-settings-players.php' );
|
||||
$settings[] = include( 'settings/class-sp-settings-text.php' );
|
||||
$settings[] = include( 'settings/class-sp-settings-config.php' );
|
||||
|
||||
self::$settings = apply_filters( 'sportspress_get_settings_pages', $settings );
|
||||
|
||||
@@ -220,7 +220,7 @@ class SP_Admin_Welcome {
|
||||
<?php SP()->countries->country_dropdown_options( $selected ); ?>
|
||||
</select>
|
||||
</p>
|
||||
<h4><?php printf( __( 'Select %s', 'sportspress' ), __( 'Sport', 'sportspress' ) ); ?></h4>
|
||||
<h4><?php _e( 'Sport', 'sportspress' ); ?></h4>
|
||||
<?php
|
||||
$sport_options = sp_get_sport_options();
|
||||
$class = 'chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' );
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -41,19 +41,10 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
* @return array
|
||||
*/
|
||||
public function get_settings() {
|
||||
$sports = sp_get_sport_options();
|
||||
|
||||
return apply_filters('sportspress_event_settings', array(
|
||||
|
||||
array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ),
|
||||
|
||||
array(
|
||||
'title' => __( 'Sport', 'sportspress' ),
|
||||
'id' => 'sportspress_sport',
|
||||
'default' => 'soccer',
|
||||
'type' => 'select',
|
||||
'options' => $sports,
|
||||
),
|
||||
|
||||
array( 'type' => 'outcomes' ),
|
||||
|
||||
@@ -76,11 +67,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
* Save settings
|
||||
*/
|
||||
public function save() {
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
||||
$sport = SP()->sports->$_POST['sportspress_sport'];
|
||||
SP_Admin_Settings::configure_sport( $sport );
|
||||
update_option( '_sp_needs_welcome', 0 );
|
||||
elseif ( isset( $_POST['sportspress_primary_result'] ) ):
|
||||
if ( isset( $_POST['sportspress_primary_result'] ) ):
|
||||
update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] );
|
||||
endif;
|
||||
|
||||
@@ -114,7 +101,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col" class="edit"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -169,7 +156,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Primary', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col" class="edit"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -237,7 +224,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col" class="edit"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -287,7 +274,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Equation', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Rounding', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
||||
@@ -344,7 +331,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col"> </th>
|
||||
<th scope="col" class="edit"></th>
|
||||
</tr>
|
||||
@@ -396,7 +383,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Key', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Equation', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Rounding', 'sportspress' ); ?></th>
|
||||
<th scope="col" class="edit"></th>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -37,9 +37,9 @@ class SP_Settings_Events extends SP_Settings_Page {
|
||||
*/
|
||||
public function get_settings() {
|
||||
|
||||
$settings = array(
|
||||
return apply_filters( 'sportspress_event_settings', array(
|
||||
|
||||
array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'event_options' ),
|
||||
array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'event_options' ),
|
||||
|
||||
array( 'type' => 'delimiter' ),
|
||||
|
||||
@@ -95,25 +95,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'calendar_options' ),
|
||||
|
||||
array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
|
||||
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
|
||||
foreach ( sp_array_value( $strings, 'event', array() ) as $key => $value ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_event_' . $key . '_text',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
|
||||
$settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
|
||||
|
||||
return apply_filters( 'sportspress_event_settings', $settings ); // End event settings
|
||||
)); // End event settings
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -39,13 +39,22 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
* @return array
|
||||
*/
|
||||
public function get_settings() {
|
||||
$sports = sp_get_sport_options();
|
||||
|
||||
$settings = array(
|
||||
return apply_filters( 'sportspress_general_settings', array(
|
||||
|
||||
array( 'title' => __( 'General Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
|
||||
|
||||
array( 'type' => 'country' ),
|
||||
|
||||
array(
|
||||
'title' => __( 'Sport', 'sportspress' ),
|
||||
'id' => 'sportspress_sport',
|
||||
'default' => 'soccer',
|
||||
'type' => 'select',
|
||||
'options' => $sports,
|
||||
),
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'general_options' ),
|
||||
|
||||
array( 'title' => __( 'Styles and Scripts', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'script_styling_options' ),
|
||||
@@ -89,25 +98,7 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'script_styling_options' ),
|
||||
|
||||
array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
|
||||
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
|
||||
foreach ( sp_array_value( $strings, 'general', array() ) as $key => $value ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_' . $key . '_text',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
|
||||
$settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
|
||||
|
||||
return apply_filters( 'sportspress_general_settings', $settings ); // End general settings
|
||||
)); // End general settings
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,9 +108,8 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
||||
$sport = SP()->sports->$_POST['sportspress_sport'];
|
||||
SP_Admin_Settings::configure_sport( $sport );
|
||||
update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
|
||||
update_option( '_sp_needs_welcome', 0 );
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$settings = $this->get_settings();
|
||||
SP_Admin_Settings::save_fields( $settings );
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -36,7 +36,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
*/
|
||||
public function get_settings() {
|
||||
|
||||
$settings = array(
|
||||
return apply_filters( 'sportspress_event_settings', array(
|
||||
|
||||
array( 'title' => __( 'Player Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'player_options' ),
|
||||
|
||||
@@ -83,25 +83,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'list_options' ),
|
||||
|
||||
array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
|
||||
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
|
||||
foreach ( sp_array_value( $strings, 'player', array() ) as $key => $value ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_player_' . $key . '_text',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
|
||||
$settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
|
||||
|
||||
return apply_filters( 'sportspress_event_settings', $settings ); // End player settings
|
||||
)); // End player settings
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
@@ -36,7 +36,7 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
||||
*/
|
||||
public function get_settings() {
|
||||
|
||||
$settings = array(
|
||||
return apply_filters( 'sportspress_event_settings', array(
|
||||
|
||||
array( 'title' => __( 'Team Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'team_options' ),
|
||||
|
||||
@@ -84,25 +84,7 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'table_options' ),
|
||||
|
||||
array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
|
||||
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
|
||||
foreach ( sp_array_value( $strings, 'team', array() ) as $key => $value ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_team_' . $key . '_text',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
|
||||
$settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
|
||||
|
||||
return apply_filters( 'sportspress_event_settings', $settings ); // End team settings
|
||||
)); // End team settings
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
65
includes/admin/settings/class-sp-settings-text.php
Normal file
65
includes/admin/settings/class-sp-settings-text.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* SportsPress Text Settings
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! class_exists( 'SP_Settings_Text' ) ) :
|
||||
|
||||
/**
|
||||
* SP_Settings_Text
|
||||
*/
|
||||
class SP_Settings_Text extends SP_Settings_Page {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'text';
|
||||
$this->label = __( 'Text', 'sportspress' );
|
||||
|
||||
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
||||
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
|
||||
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get settings array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_settings() {
|
||||
|
||||
$settings = array(
|
||||
|
||||
array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
|
||||
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
|
||||
foreach ( $strings as $key => $value ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_' . $key . '_text',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
|
||||
$settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
|
||||
|
||||
return apply_filters( 'sportspress_event_settings', $settings ); // End event settings
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
return new SP_Settings_Text();
|
||||
@@ -5,7 +5,7 @@
|
||||
* The SportsPress text class stores editable strings.
|
||||
*
|
||||
* @class SP_Text
|
||||
* @version 0.7
|
||||
* @version 0.8
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
@@ -33,18 +33,15 @@ class SP_Text {
|
||||
$this->data[ $key ] = $value;
|
||||
}
|
||||
|
||||
public function string( $string, $context = null ){
|
||||
public function string( $string ){
|
||||
if ( is_admin() )
|
||||
return $string;
|
||||
|
||||
$key = str_replace( '-', '_', sanitize_title( $string ) );
|
||||
|
||||
if ( $context == null )
|
||||
$context = 'general';
|
||||
|
||||
if ( array_key_exists( $context, $this->data ) && array_key_exists( $key, $this->data[ $context ] ) ):
|
||||
$string = get_option( 'sportspress_' . ( $context == 'general' ? '' : $context . '_' ) . $key . '_text' );
|
||||
return ( empty( $string ) ? $this->data[ $context ][ $key ] : $string );
|
||||
if ( array_key_exists( $key, $this->data ) ):
|
||||
$string = get_option( 'sportspress_' . $key . '_text' );
|
||||
return ( empty( $string ) ? $this->data[ $key ] : $string );
|
||||
else:
|
||||
return $string;
|
||||
endif;
|
||||
|
||||
@@ -205,6 +205,6 @@ if ( $pad != 0 && $pad != 7 )
|
||||
$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>";
|
||||
|
||||
if ( $id && $show_all_events_link )
|
||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
||||
|
||||
@@ -17,7 +17,7 @@ $time = get_the_time( get_option('time_format'), $id );
|
||||
$leagues = get_the_terms( $id, 'sp_league' );
|
||||
$seasons = get_the_terms( $id, 'sp_season' );
|
||||
|
||||
$data = array( SP()->text->string('Date', 'event') => $date, SP()->text->string('Time', 'event') => $time );
|
||||
$data = array( SP()->text->string('Date') => $date, SP()->text->string('Time') => $time );
|
||||
|
||||
if ( $leagues ):
|
||||
$league = array_pop( $leagues );
|
||||
@@ -29,7 +29,7 @@ if ( $seasons ):
|
||||
$data[ SP()->text->string('Season') ] = $season->name;
|
||||
endif;
|
||||
?>
|
||||
<h3><?php echo SP()->text->string('Details', 'event'); ?></h3>
|
||||
<h3><?php echo SP()->text->string('Details'); ?></h3>
|
||||
<div class="sp-table-wrapper">
|
||||
<table class="sp-event-details sp-data-table">
|
||||
<thead>
|
||||
|
||||
@@ -32,22 +32,22 @@ extract( $defaults, EXTR_SKIP );
|
||||
if ( isset( $columns ) )
|
||||
$usecolumns = $columns;
|
||||
|
||||
echo '<th class="data-date">' . SP()->text->string('Date', 'event') . '</th>';
|
||||
echo '<th class="data-date">' . SP()->text->string('Date') . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
||||
echo '<th class="data-event">' . SP()->text->string('Event', 'event') . '</th>';
|
||||
echo '<th class="data-event">' . SP()->text->string('Event') . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) )
|
||||
echo '<th class="data-teams">' . SP()->text->string('Teams', 'event') . '</th>';
|
||||
echo '<th class="data-teams">' . SP()->text->string('Teams') . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
||||
echo '<th class="data-time">' . SP()->text->string('Time', 'event') . '</th>';
|
||||
echo '<th class="data-time">' . SP()->text->string('Time') . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
||||
echo '<th class="data-venue">' . SP()->text->string('Venue', 'event') . '</th>';
|
||||
echo '<th class="data-venue">' . SP()->text->string('Venue') . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
|
||||
echo '<th class="data-article">' . SP()->text->string('Article', 'event') . '</th>';
|
||||
echo '<th class="data-article">' . SP()->text->string('Article') . '</th>';
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -129,9 +129,9 @@ extract( $defaults, EXTR_SKIP );
|
||||
endif;
|
||||
if ( $event->post_content !== null ):
|
||||
if ( $event->post_status == 'publish' ):
|
||||
echo SP()->text->string('Recap', 'event');
|
||||
echo SP()->text->string('Recap');
|
||||
else:
|
||||
echo SP()->text->string('Preview', 'event');
|
||||
echo SP()->text->string('Preview');
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@@ -148,6 +148,6 @@ extract( $defaults, EXTR_SKIP );
|
||||
</table>
|
||||
<?php
|
||||
if ( $id && $show_all_events_link )
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events') . '</a>';
|
||||
?>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@ foreach( $teams as $key => $team_id ):
|
||||
<tr>
|
||||
<?php if ( $has_players ): ?>
|
||||
<th class="data-number">#</th>
|
||||
<th class="data-name"><?php echo SP()->text->string('Player', 'event'); ?></th>
|
||||
<th class="data-name"><?php echo SP()->text->string('Player'); ?></th>
|
||||
<?php endif; foreach( $performance_labels as $key => $label ): ?>
|
||||
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
||||
<?php endforeach; ?>
|
||||
@@ -102,7 +102,7 @@ foreach( $teams as $key => $team_id ):
|
||||
<?php
|
||||
if ( $has_players ):
|
||||
echo '<td class="data-number"> </td>';
|
||||
echo '<td class="data-name">' . SP()->text->string('Total', 'event') . '</td>';
|
||||
echo '<td class="data-name">' . SP()->text->string('Total') . '</td>';
|
||||
endif;
|
||||
|
||||
$row = $data[0];
|
||||
|
||||
@@ -59,11 +59,11 @@ if ( empty( $table_rows ) ):
|
||||
|
||||
else:
|
||||
|
||||
$output .= '<h3>' . SP()->text->string('Team Results', 'event') . '</h3>';
|
||||
$output .= '<h3>' . SP()->text->string('Team Results') . '</h3>';
|
||||
|
||||
$output .= '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
||||
'<th class="data-name">' . SP()->text->string('Team', 'event') . '</th>';
|
||||
'<th class="data-name">' . SP()->text->string('Team') . '</th>';
|
||||
foreach( $result_labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
endforeach;
|
||||
|
||||
@@ -32,7 +32,7 @@ foreach( $venues as $venue ):
|
||||
$latitude = sp_array_value( $meta, 'sp_latitude', 0 );
|
||||
$longitude = sp_array_value( $meta, 'sp_longitude', 0 );
|
||||
?>
|
||||
<h3><?php echo SP()->text->string('Venue', 'event'); ?></h3>
|
||||
<h3><?php echo SP()->text->string('Venue'); ?></h3>
|
||||
<table class="sp-data-table sp-event-venue">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -41,7 +41,7 @@ if ( ! $columns )
|
||||
if ( ! is_array( $columns ) )
|
||||
$columns = explode( ',', $columns );
|
||||
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Pos', 'team') . '</th>';
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Pos') . '</th>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) )
|
||||
@@ -93,7 +93,7 @@ endforeach;
|
||||
$output .= '</tbody>' . '</table>';
|
||||
|
||||
if ( $show_full_table_link )
|
||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table', 'team') . '</a>';
|
||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table') . '</a>';
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
|
||||
@@ -28,20 +28,20 @@ $metrics = sp_get_player_metrics_data( $id );
|
||||
$common = array();
|
||||
if ( $nationality ):
|
||||
$country_name = sp_array_value( $countries, $nationality, null );
|
||||
$common[ SP()->text->string('Nationality', 'player') ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
$common[ SP()->text->string('Nationality') ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
endif;
|
||||
|
||||
$data = array_merge( $common, $metrics );
|
||||
|
||||
if ( $current_team )
|
||||
$data[ SP()->text->string('Current Team', 'player') ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
|
||||
$data[ SP()->text->string('Current Team') ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
|
||||
|
||||
if ( $past_teams ):
|
||||
$teams = array();
|
||||
foreach ( $past_teams as $team ):
|
||||
$teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>';
|
||||
endforeach;
|
||||
$data[ SP()->text->string('Past Teams', 'player') ] = implode( ', ', $teams );
|
||||
$data[ SP()->text->string('Past Teams') ] = implode( ', ', $teams );
|
||||
endif;
|
||||
|
||||
$output = '<div class="sp-list-wrapper">' .
|
||||
|
||||
@@ -136,6 +136,6 @@ $output .= "
|
||||
</div>\n";
|
||||
|
||||
if ( $show_all_players_link )
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players') . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_player_gallery', $output );
|
||||
|
||||
@@ -53,7 +53,7 @@ endif;
|
||||
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
||||
$output .= '<th class="data-number">#</th>';
|
||||
else:
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank', 'player') . '</th>';
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank') . '</th>';
|
||||
endif;
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
@@ -106,6 +106,6 @@ endforeach;
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
if ( $show_all_players_link )
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players') . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_player_list', $output );
|
||||
|
||||
@@ -92,7 +92,7 @@ foreach ( $positions as $position ):
|
||||
if ( in_array( $r['orderby'], array( 'number', 'name' ) ) ):
|
||||
$output .= '<th class="data-number">#</th>';
|
||||
else:
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank', 'player') . '</th>';
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank') . '</th>';
|
||||
endif;
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
|
||||
Reference in New Issue
Block a user