Skip to content

Commit

Permalink
Hotfix: Fatal error on WPSEO compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JoryHogeveen committed Mar 20, 2018
1 parent 3dc7836 commit 943fb47
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions includes/class-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down

0 comments on commit 943fb47

Please sign in to comment.