Skip to content

Commit

Permalink
Merge pull request #104 from humanmade/backport-103-to-v8-branch
Browse files Browse the repository at this point in the history
[Backport v8-branch] Ensure `get_plugin_data()` is available
  • Loading branch information
roborourke authored Sep 1, 2021
2 parents da4657c + ea0365a commit e174306
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ function load_wpseo() {
define( 'WPSEO_PREMIUM_BASENAME', 'wordpress-seo-premium/wp-seo-premium.php' );
}

// Ensure we have the plugin data function, sometimes not loaded outside of admin contexts.
if ( ! function_exists( 'get_plugin_data' ) ) {
require_once Altis\ROOT_DIR . '/wordpress/wp-admin/includes/plugin.php';
}

$data = get_plugin_data( WPSEO_PREMIUM_FILE );

define( 'WPSEO_PREMIUM_VERSION', $data['Version'] );
Expand Down

0 comments on commit e174306

Please sign in to comment.