From ec29ebc95b6dbc9b86ab21b7213929bd46f53acc Mon Sep 17 00:00:00 2001 From: Tom McFarlin Date: Wed, 30 Jul 2014 13:58:41 -0400 Subject: [PATCH] Renaming the plugin slug to the plugin name Also renaming the text domain in the header of the core plugin file to match that of the plugin name Fixes #194 --- .../trunk/includes/class-plugin-name.php | 20 +++++++++---------- plugin-name/trunk/plugin-name.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin-name/trunk/includes/class-plugin-name.php b/plugin-name/trunk/includes/class-plugin-name.php index d6dc688..0ae7a13 100644 --- a/plugin-name/trunk/includes/class-plugin-name.php +++ b/plugin-name/trunk/includes/class-plugin-name.php @@ -43,9 +43,9 @@ class Plugin_Name { * * @since 1.0.0 * @access protected - * @var string $plugin_slug The slug used to uniquely identify this plugin. + * @var string $plugin_name The slug used to uniquely identify this plugin. */ - protected $plugin_slug; + protected $plugin_name; /** * The current version of the plugin. @@ -67,7 +67,7 @@ class Plugin_Name { */ public function __construct() { - $this->plugin_slug = 'plugin-name-slug'; + $this->plugin_name = 'plugin-name'; $this->version = '1.0.0'; $this->load_dependencies(); @@ -134,7 +134,7 @@ class Plugin_Name { private function set_locale() { $plugin_i18n = new Plugin_Name_i18n(); - $plugin_i18n->set_domain( $this->get_plugin_slug() ); + $plugin_i18n->set_domain( $this->get_plugin_name() ); $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); @@ -149,7 +149,7 @@ class Plugin_Name { */ private function define_admin_hooks() { - $plugin_admin = new Plugin_Name_Admin( $this->get_plugin_slug(), $this->get_version() ); + $plugin_admin = new Plugin_Name_Admin( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); @@ -165,7 +165,7 @@ class Plugin_Name { */ private function define_public_hooks() { - $plugin_public = new Plugin_Name_Public( $this->get_plugin_slug(), $this->get_version() ); + $plugin_public = new Plugin_Name_Public( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); @@ -182,14 +182,14 @@ class Plugin_Name { } /** - * The slug of the plugin used to uniquely identify it within the context of + * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * * @since 1.0.0 - * @return string The slug of the plugin. + * @return string The name of the plugin. */ - public function get_plugin_slug() { - return $this->plugin_slug; + public function get_plugin_name() { + return $this->plugin_name; } /** diff --git a/plugin-name/trunk/plugin-name.php b/plugin-name/trunk/plugin-name.php index 06100e8..f47b831 100644 --- a/plugin-name/trunk/plugin-name.php +++ b/plugin-name/trunk/plugin-name.php @@ -14,7 +14,7 @@ * Version: 1.0.0 * Author: Your Name or Your Company * Author URI: http://example.com/ - * Text Domain: plugin-name-locale + * Text Domain: plugin-name * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Domain Path: /languages