Add player list widget and add league table widget columns selector
This commit is contained in:
@@ -21,7 +21,7 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
||||
elseif ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff' ) ) ):
|
||||
switch ( $untranslated_text ):
|
||||
case 'Enter title here':
|
||||
$translated_text = __( 'Name', 'sportspress' );
|
||||
$translated_text = __( '(Auto)', 'sportspress' );
|
||||
break;
|
||||
case 'Set featured image':
|
||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
||||
|
||||
@@ -33,9 +33,24 @@ add_filter( 'the_content', 'sportspress_default_team_content' );
|
||||
|
||||
function sportspress_default_table_content( $content ) {
|
||||
if ( is_singular( 'sp_table' ) && in_the_loop() ):
|
||||
$id = get_the_ID();
|
||||
$leagues = get_the_terms( $id, 'sp_league' );
|
||||
$seasons = get_the_terms( $id, 'sp_season' );
|
||||
$terms = array();
|
||||
if ( $leagues ):
|
||||
$league = reset( $leagues );
|
||||
$terms[] = $league->name;
|
||||
endif;
|
||||
if ( $seasons ):
|
||||
$season = reset( $seasons );
|
||||
$terms[] = $season->name;
|
||||
endif;
|
||||
$title = '';
|
||||
if ( sizeof( $terms ) )
|
||||
$title = '<h4 class="sp-table-caption">' . implode( ' — ', $terms ) . '</h4>';
|
||||
$table = sportspress_league_table();
|
||||
$excerpt = has_excerpt() ? wpautop( get_the_excerpt() ) : '';
|
||||
$content = $table . $content . $excerpt;
|
||||
$content = $title . $table . $content . $excerpt;
|
||||
endif;
|
||||
return $content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user