refactor: remove plugin name constant

This commit is contained in:
Ben Goldsworthy 2021-04-27 09:30:53 +01:00
parent 6fb2b20424
commit 51f3f92c26
7 changed files with 65 additions and 22 deletions

View file

@ -15,6 +15,15 @@
*/
class Footnotes_Layout_Init {
/**
* The ID of this plugin.
*
* @since 2.8.0
* @access private
* @var string $plugin_name The ID of this plugin.
*/
private $plugin_name;
/**
* Slug for the Plugin main menu.
*
@ -35,11 +44,14 @@ class Footnotes_Layout_Init {
* Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
*
* @since 1.5.0
* @since 2.8.0 Added `$plugin_name` parameter.
*/
public function __construct() {
public function __construct( $plugin_name ) {
$this->plugin_name = $plugin_name;
$this->load_dependencies();
$this->settings_page = new Footnotes_Layout_Settings();
$this->settings_page = new Footnotes_Layout_Settings($this->plugin_name);
// Register hooks/actions.
add_action( 'admin_menu', array( $this, 'register_options_submenu' ) );