Use gettext filter to modify fronted text
This commit is contained in:
@@ -43,13 +43,15 @@ class SP_Settings_Text extends SP_Settings_Page {
|
||||
);
|
||||
|
||||
$strings = sp_get_text_options();
|
||||
$options = get_option( 'sportspress_text' );
|
||||
|
||||
foreach ( $strings as $key => $value ):
|
||||
foreach ( $strings as $string ):
|
||||
$settings[] = array(
|
||||
'title' => $value,
|
||||
'id' => 'sportspress_' . $key . '_text',
|
||||
'title' => $string,
|
||||
'id' => 'sportspress_text[' . $string . ']',
|
||||
'default' => '',
|
||||
'placeholder' => $value,
|
||||
'placeholder' => $string,
|
||||
'value' => sp_array_value( $options, $string, null ),
|
||||
'type' => 'text',
|
||||
);
|
||||
endforeach;
|
||||
@@ -58,6 +60,14 @@ class SP_Settings_Text extends SP_Settings_Page {
|
||||
|
||||
return apply_filters( 'sportspress_text_settings', $settings ); // End event settings
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*/
|
||||
public function save() {
|
||||
if ( isset( $_POST['sportspress_text'] ) )
|
||||
update_option( 'sportspress_text', $_POST['sportspress_text'] );
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
@@ -316,7 +316,7 @@ class SP_League_Table extends SP_Custom_Post{
|
||||
unset( $columns[ $key ] );
|
||||
endif;
|
||||
endforeach;
|
||||
$labels = array_merge( array( 'name' => SP()->text->string('Team') ), $columns );
|
||||
$labels = array_merge( array( 'name' => __( 'Team', 'sportspress' ) ), $columns );
|
||||
$merged[0] = $labels;
|
||||
return $merged;
|
||||
endif;
|
||||
|
||||
@@ -358,7 +358,7 @@ class SP_Player_List extends SP_Custom_Post {
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
$labels = array( 'name' => SP()->text->string('Player') );
|
||||
$labels = array( 'name' => __( 'Player', 'sportspress' ) );
|
||||
if ( in_array( 'team', $this->columns ) )
|
||||
$labels['team'] = __( 'Team', 'sportspress' );
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ class SP_Player extends SP_Custom_Post {
|
||||
unset( $columns[ $key ] );
|
||||
endif;
|
||||
endforeach;
|
||||
$labels = array_merge( array( 'name' => SP()->text->string('Season'), 'team' => SP()->text->string('Team') ), $columns );
|
||||
$labels = array_merge( array( 'name' => __( 'Season', 'sportspress' ), 'team' => __( 'Team', 'sportspress' ) ), $columns );
|
||||
$merged[0] = $labels;
|
||||
return $merged;
|
||||
endif;
|
||||
|
||||
@@ -252,7 +252,7 @@ class SP_Team extends SP_Custom_Post {
|
||||
if ( $admin ):
|
||||
return array( $columns, $data, $placeholders, $merged, $leagues_seasons );
|
||||
else:
|
||||
$labels = array_merge( array( 'name' => SP()->text->string('Season') ), $columns );
|
||||
$labels = array_merge( array( 'name' => __( 'Season', 'sportspress' ) ), $columns );
|
||||
$merged[0] = $labels;
|
||||
return $merged;
|
||||
endif;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* SportsPress text
|
||||
*
|
||||
* The SportsPress text class stores editable strings.
|
||||
*
|
||||
* @class SP_Text
|
||||
* @version 0.8
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
*/
|
||||
class SP_Text {
|
||||
|
||||
/** @var array Array of text */
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* Constructor for the text class - defines all editable strings.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->data = sp_get_text_options();
|
||||
}
|
||||
|
||||
public function __get( $key ) {
|
||||
return ( array_key_exists( $key, $this->data ) ? $this->data[ $key ] : null );
|
||||
}
|
||||
|
||||
public function __set( $key, $value ){
|
||||
$this->data[ $key ] = $value;
|
||||
}
|
||||
|
||||
public function string( $string ){
|
||||
if ( is_admin() )
|
||||
return $string;
|
||||
|
||||
$key = str_replace( '-', '_', sanitize_title( $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;
|
||||
}
|
||||
}
|
||||
@@ -2387,35 +2387,35 @@ function sp_get_sport_presets() {
|
||||
*/
|
||||
function sp_get_text_options() {
|
||||
$strings = apply_filters( 'sportspress_text', array(
|
||||
'article' => __( 'Article', 'sportspress' ),
|
||||
'current_team' => __( 'Current Team', 'sportspress' ),
|
||||
'date' => __( 'Date', 'sportspress' ),
|
||||
'details' => __( 'Details', 'sportspress' ),
|
||||
'event' => __( 'Event', 'sportspress' ),
|
||||
'league' => __( 'League', 'sportspress' ),
|
||||
'nationality' => __( 'Nationality', 'sportspress' ),
|
||||
'outcome' => __( 'Outcome', 'sportspress' ),
|
||||
'past_teams' => __( 'Past Teams', 'sportspress' ),
|
||||
'played' => __( 'Played', 'sportspress' ),
|
||||
'player' => __( 'Player', 'sportspress' ),
|
||||
'pos' => __( 'Pos', 'sportspress' ),
|
||||
'position' => __( 'Position', 'sportspress' ),
|
||||
'preview' => __( 'Preview', 'sportspress' ),
|
||||
'rank' => __( 'Rank', 'sportspress' ),
|
||||
'recap' => __( 'Recap', 'sportspress' ),
|
||||
'team_results' => __( 'Team Results', 'sportspress' ),
|
||||
'season' => __( 'Season', 'sportspress' ),
|
||||
'staff' => __( 'Staff', 'sportspress' ),
|
||||
'substitutes' => __( 'Substitutes', 'sportspress' ),
|
||||
'team' => __( 'Team', 'sportspress' ),
|
||||
'teams' => __( 'Teams', 'sportspress' ),
|
||||
'time' => __( 'Time', 'sportspress' ),
|
||||
'timeresults' => __( 'Time/Results', 'sportspress' ),
|
||||
'total' => __( 'Total', 'sportspress' ),
|
||||
'venue' => __( 'Venue', 'sportspress' ),
|
||||
'view_all_events' => __( 'View all events', 'sportspress' ),
|
||||
'view_all_players' => __( 'View all players', 'sportspress' ),
|
||||
'view_full_table' => __( 'View full table', 'sportspress' ),
|
||||
__( 'Article', 'sportspress' ),
|
||||
__( 'Current Team', 'sportspress' ),
|
||||
__( 'Date', 'sportspress' ),
|
||||
__( 'Details', 'sportspress' ),
|
||||
__( 'Event', 'sportspress' ),
|
||||
__( 'League', 'sportspress' ),
|
||||
__( 'Nationality', 'sportspress' ),
|
||||
__( 'Outcome', 'sportspress' ),
|
||||
__( 'Past Teams', 'sportspress' ),
|
||||
__( 'Played', 'sportspress' ),
|
||||
__( 'Player', 'sportspress' ),
|
||||
__( 'Pos', 'sportspress' ),
|
||||
__( 'Position', 'sportspress' ),
|
||||
__( 'Preview', 'sportspress' ),
|
||||
__( 'Rank', 'sportspress' ),
|
||||
__( 'Recap', 'sportspress' ),
|
||||
__( 'Team Results', 'sportspress' ),
|
||||
__( 'Season', 'sportspress' ),
|
||||
__( 'Staff', 'sportspress' ),
|
||||
__( 'Substitutes', 'sportspress' ),
|
||||
__( 'Team', 'sportspress' ),
|
||||
__( 'Teams', 'sportspress' ),
|
||||
__( 'Time', 'sportspress' ),
|
||||
__( 'Time/Results', 'sportspress' ),
|
||||
__( 'Total', 'sportspress' ),
|
||||
__( 'Venue', 'sportspress' ),
|
||||
__( 'View all events', 'sportspress' ),
|
||||
__( 'View all players', 'sportspress' ),
|
||||
__( 'View full table', 'sportspress' ),
|
||||
));
|
||||
asort( $strings );
|
||||
return $strings;
|
||||
|
||||
@@ -190,7 +190,11 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
||||
endswitch;
|
||||
endif;
|
||||
else:
|
||||
if ( ! current_theme_supports( 'sportspress' ) && $untranslated_text == 'Archives' && is_tax( 'sp_venue' ) ):
|
||||
if ( $domain == 'sportspress' ):
|
||||
if ( ! empty( SP()->text[ $untranslated_text ] ) ):
|
||||
$translated_text = SP()->text[ $untranslated_text ];
|
||||
endif;
|
||||
elseif ( ! current_theme_supports( 'sportspress' ) && $untranslated_text == 'Archives' && is_tax( 'sp_venue' ) ):
|
||||
$slug = get_query_var( 'sp_venue' );
|
||||
if ( $slug ):
|
||||
$venue = get_term_by( 'slug', $slug, 'sp_venue' );
|
||||
|
||||
@@ -52,9 +52,9 @@ final class SportsPress {
|
||||
public $formats = null;
|
||||
|
||||
/**
|
||||
* @var SP_Text $text
|
||||
* @var array
|
||||
*/
|
||||
public $text = null;
|
||||
public $text = array();
|
||||
|
||||
/**
|
||||
* Main SportsPress Instance
|
||||
@@ -211,7 +211,6 @@ final class SportsPress {
|
||||
// Classes (used on all pages)
|
||||
include_once( 'includes/class-sp-countries.php' ); // Defines continents and countries
|
||||
include_once( 'includes/class-sp-formats.php' ); // Defines custom post type formats
|
||||
include_once( 'includes/class-sp-text.php' ); // Defines editable strings
|
||||
|
||||
// Include template hooks in time for themes to remove/modify them
|
||||
include_once( 'includes/sp-template-hooks.php' );
|
||||
@@ -261,7 +260,9 @@ final class SportsPress {
|
||||
// Load class instances
|
||||
$this->countries = new SP_Countries(); // Countries class
|
||||
$this->formats = new SP_Formats(); // Formats class
|
||||
$this->text = new SP_Text(); // Text class
|
||||
|
||||
// Load string options
|
||||
$this->text = get_option( 'sportspress_text', array() );
|
||||
|
||||
// Init action
|
||||
do_action( 'sportspress_init' );
|
||||
|
||||
@@ -102,5 +102,5 @@ if ( isset( $columns ) )
|
||||
</div>
|
||||
<?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') . '</a>';
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
?>
|
||||
@@ -209,6 +209,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') . '</a>';
|
||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
||||
|
||||
@@ -17,19 +17,19 @@ $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') => $date, SP()->text->string('Time') => $time );
|
||||
$data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time );
|
||||
|
||||
if ( $leagues ):
|
||||
$league = array_pop( $leagues );
|
||||
$data[ SP()->text->string('League') ] = $league->name;
|
||||
$data[ __( 'League', 'sportspress' ) ] = $league->name;
|
||||
endif;
|
||||
|
||||
if ( $seasons ):
|
||||
$season = array_pop( $seasons );
|
||||
$data[ SP()->text->string('Season') ] = $season->name;
|
||||
$data[ __( 'Season', 'sportspress' ) ] = $season->name;
|
||||
endif;
|
||||
?>
|
||||
<h3><?php echo SP()->text->string('Details'); ?></h3>
|
||||
<h3><?php echo __( 'Details', 'sportspress' ); ?></h3>
|
||||
<div class="sp-table-wrapper sp-scrollable-table-wrapper">
|
||||
<table class="sp-event-details sp-data-table">
|
||||
<thead>
|
||||
|
||||
@@ -42,22 +42,22 @@ if ( isset( $columns ) )
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo '<th class="data-date">' . SP()->text->string('Date') . '</th>';
|
||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
||||
echo '<th class="data-event">' . SP()->text->string('Event') . '</th>';
|
||||
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) )
|
||||
echo '<th class="data-teams">' . SP()->text->string('Teams') . '</th>';
|
||||
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
||||
echo '<th class="data-time">' . SP()->text->string('Time/Results') . '</th>';
|
||||
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
||||
echo '<th class="data-venue">' . SP()->text->string('Venue') . '</th>';
|
||||
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
||||
|
||||
if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
|
||||
echo '<th class="data-article">' . SP()->text->string('Article') . '</th>';
|
||||
echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -160,9 +160,9 @@ if ( isset( $columns ) )
|
||||
endif;
|
||||
if ( $event->post_content !== null ):
|
||||
if ( $event->post_status == 'publish' ):
|
||||
echo SP()->text->string('Recap');
|
||||
echo __( 'Recap', 'sportspress' );
|
||||
else:
|
||||
echo SP()->text->string('Preview');
|
||||
echo __( 'Preview', 'sportspress' );
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@@ -180,5 +180,5 @@ if ( isset( $columns ) )
|
||||
</div>
|
||||
<?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') . '</a>';
|
||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
?>
|
||||
@@ -47,7 +47,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'); ?></th>
|
||||
<th class="data-name"><?php echo __( 'Player'), 'sportspress' ; ?></th>
|
||||
<?php endif; foreach( $performance_labels as $key => $label ): ?>
|
||||
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
||||
<?php endforeach; ?>
|
||||
@@ -130,7 +130,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') . '</td>';
|
||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||
endif;
|
||||
|
||||
$row = $data[0];
|
||||
|
||||
@@ -83,16 +83,16 @@ if ( empty( $table_rows ) ):
|
||||
|
||||
else:
|
||||
|
||||
$output .= '<h3>' . SP()->text->string('Team Results') . '</h3>';
|
||||
$output .= '<h3>' . __( 'Team Results', 'sportspress' ) . '</h3>';
|
||||
|
||||
$output .= '<div class="sp-table-wrapper sp-scrollable-table-wrapper">' .
|
||||
'<table class="sp-event-results sp-data-table sp-responsive-table"><thead>' .
|
||||
'<th class="data-name">' . SP()->text->string('Team') . '</th>';
|
||||
'<th class="data-name">' . __( 'Team', 'sportspress' ) . '</th>';
|
||||
foreach( $result_labels as $key => $label ):
|
||||
$output .= '<th class="data-' . $key . '">' . $label . '</th>';
|
||||
endforeach;
|
||||
if ( $show_outcomes ):
|
||||
$output .= '<th class="data-outcome">' . SP()->text->string('Outcome') . '</th>';
|
||||
$output .= '<th class="data-outcome">' . __( 'Outcome', 'sportspress' ) . '</th>';
|
||||
endif;
|
||||
$output .= '</tr>' . '</thead>' . '<tbody>';
|
||||
$output .= $table_rows;
|
||||
|
||||
@@ -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'); ?></h3>
|
||||
<h3><?php _e( 'Venue', 'sportspress' ); ?></h3>
|
||||
<table class="sp-data-table sp-event-venue">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -46,7 +46,7 @@ if ( ! $columns )
|
||||
if ( ! is_array( $columns ) )
|
||||
$columns = explode( ',', $columns );
|
||||
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Pos') . '</th>';
|
||||
$output .= '<th class="data-rank">' . __( 'Pos', 'sportspress' ) . '</th>';
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) )
|
||||
@@ -107,6 +107,6 @@ $output .= '</tbody>' . '</table>';
|
||||
$output .= '</div>';
|
||||
|
||||
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') . '</a>';
|
||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View full table', 'sportspress' ) . '</a>';
|
||||
|
||||
echo $output;
|
||||
|
||||
@@ -31,7 +31,7 @@ $metrics_after = $player->metrics( false );
|
||||
$common = array();
|
||||
if ( $nationality ):
|
||||
$country_name = sp_array_value( $countries, $nationality, null );
|
||||
$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 : '—';
|
||||
$common[ __( 'Nationality', 'sportspress' ) ] = $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( $metrics_before, $common, $metrics_after );
|
||||
@@ -50,7 +50,7 @@ if ( $past_teams ):
|
||||
foreach ( $past_teams as $team ):
|
||||
$teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>';
|
||||
endforeach;
|
||||
$data[ SP()->text->string('Past Teams') ] = implode( ', ', $teams );
|
||||
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
||||
endif;
|
||||
|
||||
$output = '<div class="sp-list-wrapper">' .
|
||||
|
||||
@@ -142,4 +142,4 @@ endforeach;
|
||||
echo "</div>\n";
|
||||
|
||||
if ( $show_all_players_link )
|
||||
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players') . '</a>';
|
||||
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||
|
||||
@@ -85,7 +85,7 @@ foreach ( $groups as $group ):
|
||||
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
||||
$output .= '<th class="data-number">#</th>';
|
||||
else:
|
||||
$output .= '<th class="data-rank">' . SP()->text->string('Rank') . '</th>';
|
||||
$output .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
|
||||
endif;
|
||||
|
||||
foreach( $labels as $key => $label ):
|
||||
@@ -153,6 +153,6 @@ foreach ( $groups as $group ):
|
||||
endforeach;
|
||||
|
||||
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') . '</a>';
|
||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||
|
||||
echo apply_filters( 'sportspress_player_list', $output );
|
||||
|
||||
@@ -29,18 +29,18 @@ $past_teams = $staff->past_teams();
|
||||
$data = array();
|
||||
if ( $nationality ):
|
||||
$country_name = sp_array_value( $countries, $nationality, null );
|
||||
$data[ 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 : '—';
|
||||
$data[ __( 'Nationality', 'sportspress' ) ] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . '/assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '—';
|
||||
endif;
|
||||
|
||||
if ( $current_team )
|
||||
$data[ SP()->text->string('Current Team') ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
|
||||
$data[ __( 'Current Team', 'sportspress' ) ] = '<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') ] = implode( ', ', $teams );
|
||||
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
||||
endif;
|
||||
|
||||
$output = '<div class="sp-list-wrapper">' .
|
||||
|
||||
Reference in New Issue
Block a user