From 6db540c08f3e481143e22623ca9973e7eda31927 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 2 Aug 2021 23:18:24 +0100 Subject: [PATCH] fix: initialise plugin after 'plugins_loaded' hook Fix #189 --- src/footnotes.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/footnotes.php b/src/footnotes.php index f83c70f..cd975c7 100755 --- a/src/footnotes.php +++ b/src/footnotes.php @@ -113,7 +113,17 @@ require_once dirname( __FILE__ ) . '/includes.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 ); -// Initialize the Plugin. -$g_obj_mci_footnotes = new Footnotes(); -// Run the Plugin. -$g_obj_mci_footnotes->run(); +/** + * Initialises and runs the Plugin. + * + * 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(); +});