diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php index 50ba94f9..2b44744b 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php @@ -45,7 +45,7 @@ class SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {
- +
diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index 4ee098f3..d2959bad 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -528,7 +528,7 @@ class SP_Player extends SP_Custom_Post { if ( $outcomes ): $outcome = reset( $outcomes ); $abbreviation = sp_get_abbreviation( $outcome->ID ); - if ( empty( $abbreviation ) ) $abbreviation = mb_strtoupper( mb_substr( $outcome->post_title, 0, 1 ) ); + if ( empty( $abbreviation ) ) $abbreviation = sp_strtoupper( sp_substr( $outcome->post_title, 0, 1 ) ); $totals['streak'] = $abbreviation . $streak['count']; endif; diff --git a/includes/class-sp-team.php b/includes/class-sp-team.php index f2146405..71299822 100644 --- a/includes/class-sp-team.php +++ b/includes/class-sp-team.php @@ -323,7 +323,7 @@ class SP_Team extends SP_Custom_Post { $outcome = reset( $outcomes ); $abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true ); if ( ! $abbreviation ) - $abbreviation = mb_substr( $outcome->post_title, 0, 1 ); + $abbreviation = sp_substr( $outcome->post_title, 0, 1 ); $totals['streak'] = $abbreviation . $streak['count']; endif; diff --git a/includes/sp-api-functions.php b/includes/sp-api-functions.php index 01f17c7c..c7f5f81b 100644 --- a/includes/sp-api-functions.php +++ b/includes/sp-api-functions.php @@ -296,7 +296,7 @@ function sp_team_abbreviation( $post = 0, $forced = false ) { if ( $abbreviation ) { return $abbreviation; } else { - return $forced ? mb_substr( mb_strtoupper( sp_team_short_name( $post ) ), 0, 3 ) : sp_team_short_name( $post ); + return $forced ? sp_substr( sp_strtoupper( sp_team_short_name( $post ) ), 0, 3 ) : sp_team_short_name( $post ); } } diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 4a9949f6..596a3aa4 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -123,6 +123,22 @@ function sp_locate_template( $template_name, $template_path = '', $default_path return apply_filters('sportspress_locate_template', $template, $template_name, $template_path); } +function sp_substr( $string = '' ) { + if ( function_exists( 'mb_substr' ) ) { + return mb_substr( $string ); + } else { + return substr( $string ); + } +} + +function sp_strtoupper( $string = '' ) { + if ( function_exists( 'mb_strtoupper' ) ) { + return mb_strtoupper( $string ); + } else { + return strtoupper( $string ); + } +} + /** * Get the timezone string. * @@ -152,7 +168,7 @@ function sp_get_timezone() { /* deprecated functions below */ -if( !function_exists( 'date_diff' ) ) { +if ( !function_exists( 'date_diff' ) ) { class DateInterval { public $y; public $m;