Skip to content

Commit

Permalink
used explode instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
pbking committed May 16, 2024
1 parent 91e0b93 commit 0a8b55b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions admin/create-theme/theme-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,8 @@ public static function replace_screenshot( $new_screenshot_path ) {
* Example: 6.5
*/
public static function get_current_wordpress_version() {
$wp_version = get_bloginfo( 'version' );
if ( preg_match( '/^\d+\.\d+/', $wp_version, $matches ) ) {
$wp_version = $matches[0];
}
return $wp_version;
$wp_version = get_bloginfo( 'version' );
$wp_version_parts = explode( '.', $wp_version );
return $wp_version_parts[0] . '.' . $wp_version_parts[1];
}
}

0 comments on commit 0a8b55b

Please sign in to comment.