From cd5e787b8e32d543d9a7e6e774390dc028d6362a Mon Sep 17 00:00:00 2001 From: Geert De Deckere Date: Mon, 26 Aug 2013 15:37:21 +0200 Subject: [PATCH 1/2] @const is not an official part of PHPDoc Pointed out by @GaryJones: https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/commit/4d629b53238b101f71e718f4c41de45997298a69#commitcomment-3943262 --- plugin-name/class-plugin-name.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-name/class-plugin-name.php b/plugin-name/class-plugin-name.php index ef684b7..9bfa4e2 100644 --- a/plugin-name/class-plugin-name.php +++ b/plugin-name/class-plugin-name.php @@ -24,7 +24,7 @@ class Plugin_Name { * * @since 1.0.0 * - * @const string + * @var string */ const VERSION = '1.0.0'; From d3bb173acac8f5bf000135ab59041a4417d6c378 Mon Sep 17 00:00:00 2001 From: Geert De Deckere Date: Mon, 26 Aug 2013 15:40:58 +0200 Subject: [PATCH 2/2] Replacing `$this->version` by the new class constant --- plugin-name/class-plugin-name.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin-name/class-plugin-name.php b/plugin-name/class-plugin-name.php index 9bfa4e2..7875067 100644 --- a/plugin-name/class-plugin-name.php +++ b/plugin-name/class-plugin-name.php @@ -158,7 +158,7 @@ class Plugin_Name { $screen = get_current_screen(); if ( $screen->id == $this->plugin_screen_hook_suffix ) { - wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'css/admin.css', __FILE__ ), array(), $this->version ); + wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'css/admin.css', __FILE__ ), array(), self::VERSION ); } } @@ -178,7 +178,7 @@ class Plugin_Name { $screen = get_current_screen(); if ( $screen->id == $this->plugin_screen_hook_suffix ) { - wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), $this->version ); + wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), self::VERSION ); } } @@ -189,7 +189,7 @@ class Plugin_Name { * @since 1.0.0 */ public function enqueue_styles() { - wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'css/public.css', __FILE__ ), array(), $this->version ); + wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'css/public.css', __FILE__ ), array(), self::VERSION ); } /** @@ -198,7 +198,7 @@ class Plugin_Name { * @since 1.0.0 */ public function enqueue_scripts() { - wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'js/public.js', __FILE__ ), array( 'jquery' ), $this->version ); + wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION ); } /**