Skip to content

Commit

Permalink
fix: don't use a hook to load plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
carlalexander committed Apr 15, 2021
1 parent 857c2d3 commit 412d7e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ymir.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@

global $ymir;

// Load "is_plugin_active" function used by the plugin
if (!function_exists('is_plugin_active')) {
require_once ABSPATH.'wp-admin/includes/plugin.php';
}

// Add load plugin action
add_action('after_setup_theme', array($ymir, 'load'));
$ymir->load();

// Load Ymir pluggable functions if the plugin is active
if (!function_exists('is_plugin_active')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if (is_plugin_active(plugin_basename(__FILE__))) {
require_once __DIR__.'/pluggable.php';
}

0 comments on commit 412d7e6

Please sign in to comment.