diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php index 044a2290..f89fa83c 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php @@ -31,7 +31,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config { } // Post Meta - $single = get_post_meta( $post->ID, 'sp_single', true ); + $singular = get_post_meta( $post->ID, 'sp_singular', true ); $section = get_post_meta( $post->ID, 'sp_section', true ); if ( '' === $section ) { $section = -1; @@ -54,9 +54,9 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config { readonly="readonly">

-

+

- +

@@ -140,7 +140,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config { */ public static function save( $post_id, $post ) { self::delete_duplicate( $_POST ); - update_post_meta( $post_id, 'sp_single', sp_array_value( $_POST, 'sp_single', '' ) ); + update_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '' ) ); update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) ); update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) ); update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) ); diff --git a/includes/class-sp-event.php b/includes/class-sp-event.php index 9185cb78..c6fb69af 100644 --- a/includes/class-sp-event.php +++ b/includes/class-sp-event.php @@ -364,7 +364,7 @@ class SP_Event extends SP_Custom_Post{ $icon = ''; if ( has_post_thumbnail( $post->ID ) ) { - $icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $post->ID ) ) ); + $icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post->ID ) ) ); } $performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 ); } diff --git a/includes/sp-api-functions.php b/includes/sp-api-functions.php index ac894279..ab197caf 100644 --- a/includes/sp-api-functions.php +++ b/includes/sp-api-functions.php @@ -163,10 +163,10 @@ function sp_get_performance( $post = 0 ) { return $event->performance(); } -function sp_get_single_name( $post = 0 ) { - $single = get_post_meta( $post, 'sp_single', true ); - if ( '' !== $single ) { - return $single; +function sp_get_singular_name( $post = 0 ) { + $singular = get_post_meta( $post, 'sp_singular', true ); + if ( '' !== $singular ) { + return $singular; } else { return get_the_title( $post ); } diff --git a/modules/sportspress-icons.php b/modules/sportspress-icons.php index 8163a07a..f286149d 100644 --- a/modules/sportspress-icons.php +++ b/modules/sportspress-icons.php @@ -104,7 +104,7 @@ class SportsPress_Icons { if ( ! $id || ! $value ) return $icons; $icon = get_post_meta( $id, 'sp_icon', true ); if ( null !== $icon && in_array( $icon, $this->icons ) ) { - $title = sp_get_single_name( $id ); + $title = sp_get_singular_name( $id ); $color = get_post_meta( $id, 'sp_color', true ); preg_match( '#\((.*?)\)#', $value, $match ); if ( ! empty( $match ) && isset( $match[1] ) ) { diff --git a/templates/event-performance-table-combined.php b/templates/event-performance-table-combined.php index 716c380c..0a187e03 100644 --- a/templates/event-performance-table-combined.php +++ b/templates/event-performance-table-combined.php @@ -110,7 +110,7 @@ if ( ! isset( $class ) ) $class = null; $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): - $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $performance_id ) ) ) . ' ', $value ); + $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value ); endif; echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index 3355d147..a475ec03 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -162,7 +162,7 @@ if ( ! isset( $subs ) ) $subs = array(); $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): - $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $performance_id ) ) ) . ' ', $value ); + $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value ); endif; echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; @@ -218,7 +218,7 @@ if ( ! isset( $subs ) ) $subs = array(); $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): - $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $performance_id ) ) ) . ' ', $value ); + $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value ); endif; echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif;