Skip to content

Commit

Permalink
Plugin tweaks: Check Jetpack version before enabling "blocks" module
Browse files Browse the repository at this point in the history
In earlier versions, the file does not exist as a loadable module, which causes a PHP warning. WordCamp is pinned to an earlier version of Jetpack, so the warning appears. WordPress.org is a later version, which needs the module loaded.
  • Loading branch information
ryelle committed Feb 19, 2025
1 parent 135b4df commit 7e145c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mu-plugins/plugin-tweaks/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* @return string[]
*/
function available_jetpack_blocks( $modules, $min_version ) {
if ( ! defined( 'JETPACK__VERSION' ) || version_compare( JETPACK__VERSION, '13.8', '<=' ) ) {
return $modules;
}
if ( ! isset( $modules['blocks'] ) ) {
$modules['blocks'] = $min_version;
}
Expand Down

0 comments on commit 7e145c3

Please sign in to comment.