Add events list template
This commit is contained in:
@@ -67,7 +67,7 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
||||
endif;
|
||||
|
||||
if ( $team_result != null ):
|
||||
echo '<strong>' . $team_result . '</strong> ';
|
||||
echo '<strong class="result">' . $team_result . '</strong> ';
|
||||
endif;
|
||||
|
||||
echo $team->post_title;
|
||||
|
||||
@@ -49,9 +49,15 @@ function sportspress_save_post( $post_id ) {
|
||||
// Update venue taxonomy
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
|
||||
|
||||
// Update video
|
||||
update_post_meta( $post_id, 'sp_video', sportspress_array_value( $_POST, 'sp_video', null ) );
|
||||
|
||||
break;
|
||||
|
||||
case ( 'sp_calendar' ):
|
||||
|
||||
// Update columns array
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
|
||||
// Update format
|
||||
update_post_meta( $post_id, 'sp_format', sportspress_array_value( $_POST, 'sp_format', 'calendar' ) );
|
||||
@@ -171,7 +177,7 @@ function sportspress_save_post( $post_id ) {
|
||||
case ( 'sp_list' ):
|
||||
|
||||
// Update statistics array
|
||||
update_post_meta( $post_id, 'sp_statistics', sportspress_array_value( $_POST, 'sp_statistics', array() ) );
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
|
||||
// Update players array
|
||||
update_post_meta( $post_id, 'sp_players', sportspress_array_value( $_POST, 'sp_players', array() ) );
|
||||
|
||||
@@ -13,16 +13,42 @@ function sportspress_default_event_content( $content ) {
|
||||
$results = sportspress_event_results();
|
||||
$players = sportspress_event_players();
|
||||
$staff = sportspress_event_staff();
|
||||
$id = get_the_ID();
|
||||
$video_url = get_post_meta( $id, 'sp_video', true );
|
||||
if ( $video_url ):
|
||||
global $wp_embed;
|
||||
$video = $wp_embed->autoembed( $video_url );
|
||||
else:
|
||||
$video = '';
|
||||
endif;
|
||||
if ( $results ):
|
||||
$content = $results . $details . $players . $staff . $content;
|
||||
$content = $video . $results . $details . $players . $staff . $content;
|
||||
else:
|
||||
$venue = sportspress_event_venue();
|
||||
$content = $details . $venue . $players . $staff . $content;
|
||||
$content = $video . $details . $venue . $players . $staff . $content;
|
||||
endif;
|
||||
endif;
|
||||
return $content;
|
||||
}
|
||||
add_filter( 'the_content', 'sportspress_default_event_content' );
|
||||
add_filter( 'the_content', 'sportspress_default_event_content', 7 );
|
||||
|
||||
function sportspress_default_calendar_content( $content ) {
|
||||
if ( is_singular( 'sp_calendar' ) && in_the_loop() ):
|
||||
$id = get_the_ID();
|
||||
$format = get_post_meta( $id, 'sp_format', true );
|
||||
switch ( $format ):
|
||||
case 'list':
|
||||
$calendar = sportspress_events_list( $id );
|
||||
break;
|
||||
default:
|
||||
$calendar = sportspress_events_calendar( $id, true, false );
|
||||
break;
|
||||
endswitch;
|
||||
$content = $calendar . $content;
|
||||
endif;
|
||||
return $content;
|
||||
}
|
||||
add_filter( 'the_content', 'sportspress_default_calendar_content' );
|
||||
|
||||
function sportspress_default_team_content( $content ) {
|
||||
if ( is_singular( 'sp_team' ) && in_the_loop() ):
|
||||
|
||||
Reference in New Issue
Block a user