diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php index eddcaa12..38142f2d 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php @@ -20,6 +20,7 @@ class SP_Meta_Box_Calendar_Details { */ public static function output( $post ) { $taxonomies = get_object_taxonomies( 'sp_calendar' ); + $caption = get_post_meta( $post->ID, 'sp_caption', true ); $status = get_post_meta( $post->ID, 'sp_status', true ); $date = get_post_meta( $post->ID, 'sp_date', true ); $date_from = get_post_meta( $post->ID, 'sp_date_from', true ); @@ -29,6 +30,9 @@ class SP_Meta_Box_Calendar_Details { $order = get_post_meta( $post->ID, 'sp_order', true ); ?>
+

+

+

ID, 'sp_caption', true ); $team_id = get_post_meta( $post->ID, 'sp_team', true ); $grouping = get_post_meta( $post->ID, 'sp_grouping', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); @@ -31,6 +32,9 @@ class SP_Meta_Box_List_Details { } ?>

+

+

+ ID, 'sp_caption', true ); $select = get_post_meta( $post->ID, 'sp_select', true ); if ( ! $select ) { global $pagenow; @@ -28,6 +29,9 @@ class SP_Meta_Box_Table_Details { } ?>
+

+

+ __( 'League Table', 'sportspress' ) ) ); + sp_get_template( 'league-table.php' ); } } diff --git a/templates/event-blocks.php b/templates/event-blocks.php index 367b1179..a1bbbeae 100644 --- a/templates/event-blocks.php +++ b/templates/event-blocks.php @@ -53,8 +53,13 @@ if ( $order != 'default' ) $data = $calendar->data(); $usecolumns = $calendar->columns; -if ( $show_title && false === $title && $id ) - $title = get_the_title( $id ); +if ( $show_title && false === $title && $id ): + $caption = $calendar->caption; + if ( $caption ) + $title = $caption; + else + $title = get_the_title( $id ); +endif; if ( isset( $columns ) ) { $usecolumns = $columns; diff --git a/templates/event-list.php b/templates/event-list.php index 3112e0c9..c7ca36a4 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -62,8 +62,13 @@ if ( isset( $columns ) ): $usecolumns = explode( ',', $columns ); endif; -if ( $show_title && false === $title && $id ) - $title = get_the_title( $id ); +if ( $show_title && false === $title && $id ): + $caption = $calendar->caption; + if ( $caption ) + $title = $caption; + else + $title = get_the_title( $id ); +endif; ?>
diff --git a/templates/league-table.php b/templates/league-table.php index e45af1f2..87ce85b3 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -31,8 +31,13 @@ if ( ! isset( $highlight ) ) $highlight = get_post_meta( $id, 'sp_highlight', tr $table = new SP_League_Table( $id ); -if ( $show_title && false === $title && $id ) - $title = get_the_title( $id ); +if ( $show_title && false === $title && $id ): + $caption = $table->caption; + if ( $caption ) + $title = $caption; + else + $title = get_the_title( $id ); +endif; $output = ''; diff --git a/templates/player-list.php b/templates/player-list.php index 1d47824c..8bcccefa 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -74,8 +74,13 @@ $output = ''; if ( $grouping === 'position' ): $groups = get_terms( 'sp_position', array( 'orderby' => 'slug' ) ); else: - if ( $show_title && false === $title && $id ) - get_the_title( $id ); + if ( $show_title && false === $title && $id ): + $caption = $list->caption; + if ( $caption ) + $title = $caption; + else + $title = get_the_title( $id ); + endif; if ( $title ) $output .= '<' . $grouptag . ' class="sp-table-caption">' . $title . ''; $group = new stdClass();