diff --git a/includes/class-compat.php b/includes/class-compat.php index 45f13dbb..03c885cc 100644 --- a/includes/class-compat.php +++ b/includes/class-compat.php @@ -331,13 +331,23 @@ public function get_plugin_capabilities( $caps = array() ) { // @since 1.7.4 Yoast SEO 5.5+ Load integration on front end. if ( ! is_admin() && VAA_API::exists_callable( array( 'WPSEO_Capability_Manager_Integration', 'register_hooks' ) ) ) { /** - * Registers the capabilities in the `members_get_capabilities` filter. - * @since Yoast SEO 5.8+ - * @link https://github.com/Yoast/wordpress-seo/pull/7937 + * Make sure WPSEO_Options::$backfill is instantiated. + * @link https://github.com/Yoast/wordpress-seo/pull/9285 + * @since Yoast SEO 7.1+ + * @since 1.7.6.1 */ - if ( VAA_API::exists_callable( array( 'WPSEO_Capability_Manager_Factory', 'get' ), 'debug' ) ) { - $wpseo = new WPSEO_Capability_Manager_Integration( WPSEO_Capability_Manager_Factory::get() ); - $wpseo->register_hooks(); + if ( VAA_API::exists_callable( array( 'WPSEO_Options', 'get_instance' ) ) ) { + WPSEO_Options::get_instance(); + + /** + * Registers the capabilities in the `members_get_capabilities` filter. + * @since Yoast SEO 5.8+ + * @link https://github.com/Yoast/wordpress-seo/pull/7937 + */ + if ( VAA_API::exists_callable( array( 'WPSEO_Capability_Manager_Factory', 'get' ), 'debug' ) ) { + $wpseo = new WPSEO_Capability_Manager_Integration( WPSEO_Capability_Manager_Factory::get() ); + $wpseo->register_hooks(); + } } }