Skip to content

Commit f012728

Browse files
Jake Goldmanclaude
authored andcommitted
fix: don't reject WordPress 7.0 prereleases (v0.9.1)
The previous version_compare against '7.0' rejected any prerelease string like '7.0-RC1' or '7.0-beta3', because version_compare sorts prereleases below the bare version. Drop the WP version check entirely and rely on function_exists('wp_ai_client_prompt') as the actual signal the AI Client API is available, regardless of the WordPress version label. The PHP version check is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2878044 commit f012728

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

github-release-posts.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@
3939
define( 'GITHUB_RELEASE_POSTS_INC', GITHUB_RELEASE_POSTS_PATH . 'includes/' );
4040
}
4141

42-
// Bail early on incompatible WordPress or PHP versions, before loading the
43-
// autoloader or referencing any plugin classes. This keeps the plugin from
44-
// fataling on older WordPress installs where the AI Client API is missing
45-
// or the underlying types it depends on are unavailable.
46-
global $wp_version;
42+
// Bail early on incompatible environments, before loading the autoloader
43+
// or referencing any plugin classes. The presence of wp_ai_client_prompt()
44+
// is the actual signal we care about (rather than the WordPress version
45+
// string, which sorts prereleases like "7.0-RC1" below "7.0").
4746
if (
48-
version_compare( (string) ( $wp_version ?? '0' ), '7.0', '<' )
49-
|| version_compare( PHP_VERSION, '8.2', '<' )
47+
version_compare( PHP_VERSION, '8.2', '<' )
5048
|| ! function_exists( 'wp_ai_client_prompt' )
5149
) {
5250
add_action(

0 commit comments

Comments
 (0)