fix: initialise plugin after 'plugins_loaded' hook

Fix #189
This commit is contained in:
Ben Goldsworthy 2021-08-02 23:18:24 +01:00
parent e22ae3c15b
commit 6db540c08f

View file

@ -113,7 +113,17 @@ require_once dirname( __FILE__ ) . '/includes.php';
$l_str_plugin_file = 'footnotes/footnotes.php'; $l_str_plugin_file = 'footnotes/footnotes.php';
add_filter( "plugin_action_links_{$l_str_plugin_file}", array( 'Footnotes_Hooks', 'get_plugin_links' ), 10, 2 ); add_filter( "plugin_action_links_{$l_str_plugin_file}", array( 'Footnotes_Hooks', 'get_plugin_links' ), 10, 2 );
// Initialize the Plugin. /**
$g_obj_mci_footnotes = new Footnotes(); * Initialises and runs the Plugin.
// Run the Plugin. *
$g_obj_mci_footnotes->run(); * This takes place after the `plugins_loaded` hook, so that
* other Plugins may filter options.
*
* @since 2.7.4
*/
add_action( 'plugins_loaded', function() {
// Initialize the Plugin.
$g_obj_mci_footnotes = new Footnotes();
// Run the Plugin.
$g_obj_mci_footnotes->run();
});