| @@ -4,8 +4,10 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +use Automattic\Jetpack\Feature_Policy; | |
| 9 | + | |
| 8 | 10 | /** |
| 9 | 11 | * Provides methods for dealing with module overrides. |
| 10 | 12 | * |
| 11 | 13 | * @since 5.9.0 |
| @@ -36,9 +38,13 @@ | ||
| 36 | 38 | * |
| 37 | 39 | * @return bool Whether there is a filter on the jetpack_active_modules option. |
| 38 | 40 | */ |
| 39 | 41 | public function do_overrides_exist() { |
| 40 | - return (bool) ( has_filter( 'option_jetpack_active_modules' ) || has_filter( 'jetpack_active_modules' ) ); | |
| 42 | + if ( method_exists( Feature_Policy::class, 'ensure_hooks' ) ) { | |
| 43 | + Feature_Policy::ensure_hooks(); | |
| 44 | + } | |
| 45 | + | |
| 46 | + return ( has_filter( 'option_jetpack_active_modules' ) || has_filter( 'jetpack_active_modules' ) ); | |
| 41 | 47 | } |
| 42 | 48 | |
| 43 | 49 | /** |
| 44 | 50 | * Gets the override for a given module. |