chore: lint code
This commit is contained in:
parent
4415c98eaa
commit
d3283bdb02
8 changed files with 25 additions and 19 deletions
|
@ -36,7 +36,7 @@ class Footnotes_Admin {
|
||||||
* @var string $version The current version of this plugin.
|
* @var string $version The current version of this plugin.
|
||||||
*/
|
*/
|
||||||
private $version;
|
private $version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The WYSIWYG editor integration object.
|
* The WYSIWYG editor integration object.
|
||||||
*
|
*
|
||||||
|
@ -79,14 +79,14 @@ class Footnotes_Admin {
|
||||||
*/
|
*/
|
||||||
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-footnotes-wysiwyg.php';
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-footnotes-wysiwyg.php';
|
||||||
|
|
||||||
$this->wysiwyg = new Footnotes_WYSIWYG($this->plugin_name);
|
$this->wysiwyg = new Footnotes_WYSIWYG( $this->plugin_name );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class responsible for constructing the plugin dashboard page(s).
|
* The class responsible for constructing the plugin dashboard page(s).
|
||||||
*/
|
*/
|
||||||
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-footnotes-layout-init.php';
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-footnotes-layout-init.php';
|
||||||
|
|
||||||
new Footnotes_Layout_Init($this->plugin_name);
|
new Footnotes_Layout_Init( $this->plugin_name );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Footnotes_WYSIWYG {
|
||||||
* @var string $plugin_name The ID of this plugin.
|
* @var string $plugin_name The ID of this plugin.
|
||||||
*/
|
*/
|
||||||
private $plugin_name;
|
private $plugin_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the class and set its properties.
|
* Initialize the class and set its properties.
|
||||||
*
|
*
|
||||||
|
@ -42,9 +42,11 @@ class Footnotes_WYSIWYG {
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @param array $p_arr_buttons pre defined Buttons from WordPress.
|
* @param array $p_arr_buttons pre defined Buttons from WordPress.
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
|
* @todo Does this need to be `static`?
|
||||||
*/
|
*/
|
||||||
public static function new_visual_editor_button( $p_arr_buttons ) {
|
public static function new_visual_editor_button( $p_arr_buttons ) {
|
||||||
array_push( $p_arr_buttons, $this->plugin_name );
|
array_push( $p_arr_buttons, 'footnotes' );
|
||||||
return $p_arr_buttons;
|
return $p_arr_buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,9 +68,11 @@ class Footnotes_WYSIWYG {
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @param array $p_arr_plugins Scripts to be included to the editor.
|
* @param array $p_arr_plugins Scripts to be included to the editor.
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
|
* @todo Does this need to be `static`?
|
||||||
*/
|
*/
|
||||||
public static function include_scripts( $p_arr_plugins ) {
|
public static function include_scripts( $p_arr_plugins ) {
|
||||||
$p_arr_plugins[ $this->plugin_name ] = plugins_url( '/../admin/js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', __FILE__ );
|
$p_arr_plugins['footnotes'] = plugins_url( '/../admin/js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', __FILE__ );
|
||||||
return $p_arr_plugins;
|
return $p_arr_plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ abstract class Footnotes_Layout_Engine {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
abstract protected function get_meta_boxes();
|
abstract protected function get_meta_boxes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array describing a sub page section.
|
* Returns an array describing a sub page section.
|
||||||
*
|
*
|
||||||
|
|
|
@ -43,15 +43,17 @@ class Footnotes_Layout_Init {
|
||||||
/**
|
/**
|
||||||
* Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
|
* Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
|
||||||
*
|
*
|
||||||
|
* @param string $plugin_name The name of the plugin.
|
||||||
|
*
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @since 2.8.0 Added `$plugin_name` parameter.
|
* @since 2.8.0 Added `$plugin_name` parameter.
|
||||||
*/
|
*/
|
||||||
public function __construct( $plugin_name ) {
|
public function __construct( $plugin_name ) {
|
||||||
$this->plugin_name = $plugin_name;
|
$this->plugin_name = $plugin_name;
|
||||||
|
|
||||||
$this->load_dependencies();
|
$this->load_dependencies();
|
||||||
|
|
||||||
$this->settings_page = new Footnotes_Layout_Settings($this->plugin_name);
|
$this->settings_page = new Footnotes_Layout_Settings( $this->plugin_name );
|
||||||
|
|
||||||
// Register hooks/actions.
|
// Register hooks/actions.
|
||||||
add_action( 'admin_menu', array( $this, 'register_options_submenu' ) );
|
add_action( 'admin_menu', array( $this, 'register_options_submenu' ) );
|
||||||
|
|
|
@ -49,7 +49,7 @@ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-footnotes-la
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*/
|
*/
|
||||||
class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
|
class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the class and set its properties.
|
* Initialize the class and set its properties.
|
||||||
*
|
*
|
||||||
|
|
|
@ -167,9 +167,9 @@ class Footnotes {
|
||||||
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
|
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
|
||||||
|
|
||||||
$this->loader->add_filter( 'plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'footnotes_action_links' );
|
$this->loader->add_filter( 'plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'footnotes_action_links' );
|
||||||
|
|
||||||
$this->loader->add_filter( 'mce_buttons', $plugin_admin->wysiwyg, 'new_visual_editor_button' );
|
$this->loader->add_filter( 'mce_buttons', $plugin_admin->wysiwyg, 'new_visual_editor_button' );
|
||||||
$this->loader->add_action( 'admin_print_footer_scripts', $plugin_admin->wysiwyg, 'new_plain_text_editor_button' );
|
$this->loader->add_action( 'admin_print_footer_scripts', $plugin_admin->wysiwyg, 'new_plain_text_editor_button' );
|
||||||
|
|
||||||
$this->loader->add_filter( 'mce_external_plugins', $plugin_admin->wysiwyg, 'include_scripts' );
|
$this->loader->add_filter( 'mce_external_plugins', $plugin_admin->wysiwyg, 'include_scripts' );
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ class Footnotes {
|
||||||
|
|
||||||
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
|
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
|
||||||
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
|
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
|
||||||
|
|
||||||
$this->loader->add_action( 'widgets_init', $plugin_public, 'register_widgets' );
|
$this->loader->add_action( 'widgets_init', $plugin_public, 'register_widgets' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Footnotes_Public {
|
||||||
* @var string $version The current version of this plugin.
|
* @var string $version The current version of this plugin.
|
||||||
*/
|
*/
|
||||||
private $version;
|
private $version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The reference container widget.
|
* The reference container widget.
|
||||||
*
|
*
|
||||||
|
@ -133,8 +133,8 @@ class Footnotes_Public {
|
||||||
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-footnotes-parser.php';
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-footnotes-parser.php';
|
||||||
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget/class-footnotes-widget-reference-container.php';
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget/class-footnotes-widget-reference-container.php';
|
||||||
|
|
||||||
$this->reference_container_widget = new Footnotes_Widget_Reference_Container($this->plugin_name);
|
$this->reference_container_widget = new Footnotes_Widget_Reference_Container( $this->plugin_name );
|
||||||
|
|
||||||
$this->a_obj_task = new Footnotes_Parser();
|
$this->a_obj_task = new Footnotes_Parser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ class Footnotes_Public {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the widget(s) for the public-facing side of the site.
|
* Register the widget(s) for the public-facing side of the site.
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base {
|
||||||
* @var string $plugin_name The ID of this plugin.
|
* @var string $plugin_name The ID of this plugin.
|
||||||
*/
|
*/
|
||||||
private $plugin_name;
|
private $plugin_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the class and set its properties.
|
* Initialize the class and set its properties.
|
||||||
*
|
*
|
||||||
|
|
Reference in a new issue