@@ -204,11 +204,11 @@ function woo_dash_page(){
* TODO Icon Placeholders for the ActivityPanel, when we implement the new designs.
*/
function woocommerce_embed_page_header() {
- if ( ! woo_dash_is_embed_enabled_wc_page() ) {
+ if ( ! wc_admin_is_embed_enabled_wc_page() ) {
return;
}
- $sections = woo_dash_get_embed_breadcrumbs();
+ $sections = wc_admin_get_embed_breadcrumbs();
$sections = is_array( $sections ) ? $sections : array( $sections );
$breadcrumbs = '';
foreach ( $sections as $section ) {
@@ -220,7 +220,7 @@ function woocommerce_embed_page_header() {
diff --git a/plugins/woocommerce-admin/lib/client-assets.php b/plugins/woocommerce-admin/lib/client-assets.php
index c83003e973e..6c65b95f9e5 100644
--- a/plugins/woocommerce-admin/lib/client-assets.php
+++ b/plugins/woocommerce-admin/lib/client-assets.php
@@ -1,12 +1,14 @@
admin_url(),
- 'embedBreadcrumbs' => woo_dash_get_embed_breadcrumbs(),
+ 'embedBreadcrumbs' => wc_admin_get_embed_breadcrumbs(),
'siteLocale' => esc_attr( get_bloginfo( 'language' ) ),
- 'currency' => woo_dash_currency_settings(),
+ 'currency' => wc_admin_currency_settings(),
'date' => array(
'dow' => get_option( 'start_of_week', 0 ),
),
);
wp_add_inline_script(
- WOO_DASH_APP,
+ WC_ADMIN_APP,
'var wcSettings = '. json_encode( $settings ) . ';',
'before'
);
// Resets lodash to wp-admin's version of lodash
wp_add_inline_script(
- WOO_DASH_APP,
+ WC_ADMIN_APP,
'_.noConflict();',
'after'
);
}
-add_action( 'admin_enqueue_scripts', 'woo_dash_register_script' );
+add_action( 'admin_enqueue_scripts', 'wc_admin_register_script' );
/**
* Load plugin text domain for translations.
*/
-function woo_dash_load_plugin_textdomain() {
- load_plugin_textdomain( 'woo-dash', false, basename( dirname( __FILE__ ) ) . '/languages' );
+function wc_admin_load_plugin_textdomain() {
+ load_plugin_textdomain( 'wc-admin', false, basename( dirname( __FILE__ ) ) . '/languages' );
}
-add_action( 'plugins_loaded', 'woo_dash_load_plugin_textdomain' );
+add_action( 'plugins_loaded', 'wc_admin_load_plugin_textdomain' );
diff --git a/plugins/woocommerce-admin/lib/common.php b/plugins/woocommerce-admin/lib/common.php
index 1557a6e7f03..d3669037dc0 100644
--- a/plugins/woocommerce-admin/lib/common.php
+++ b/plugins/woocommerce-admin/lib/common.php
@@ -6,7 +6,7 @@
*
* @return string Root path to the gutenberg custom fields plugin.
*/
-function woo_dash_dir_path( $file = '' ) {
+function wc_admin_dir_path( $file = '' ) {
return plugin_dir_path( dirname(__FILE__ ) ) . $file;
}
@@ -17,7 +17,7 @@ function woo_dash_dir_path( $file = '' ) {
*
* @return string Fully qualified URL pointing to the desired file.
*/
-function woo_dash_url( $path ) {
+function wc_admin_url( $path ) {
return plugins_url( $path, dirname( __FILE__ ) );
}
@@ -31,8 +31,8 @@ function woo_dash_url( $path ) {
*
* @return string Current screen ID.
*/
-function woo_dash_get_current_screen_id() {
- $current_screen = get_current_screen();
+function wc_admin_get_current_screen_id() {
+ $current_screen = get_current_screen();
if ( ! $current_screen ) {
return false;
}
@@ -50,8 +50,8 @@ function woo_dash_get_current_screen_id() {
*
* TODO When merging to core, we should explore a better API for defining breadcrumbs, instead of just defining an array.
*/
-function woo_dash_get_embed_breadcrumbs() {
- $current_screen_id = woo_dash_get_current_screen_id();
+function wc_admin_get_embed_breadcrumbs() {
+ $current_screen_id = wc_admin_get_current_screen_id();
// If a page has a tab, we can append that to the screen ID and show another pagination level
$pages_with_tabs = array(
@@ -66,123 +66,123 @@ function woo_dash_get_embed_breadcrumbs() {
}
}
- $breadcrumbs = apply_filters( 'woo_dash_get_breadcrumbs', array(
- 'edit-shop_order' => __( 'Orders', 'woo-dash' ),
+ $breadcrumbs = apply_filters( 'wc_admin_get_breadcrumbs', array(
+ 'edit-shop_order' => __( 'Orders', 'wc-admin' ),
'add-shop_order' => array(
- array( '/edit.php?post_type=shop_order', __( 'Orders', 'woo-dash' ) ),
- __( 'Add New', 'woo-dash' )
+ array( '/edit.php?post_type=shop_order', __( 'Orders', 'wc-admin' ) ),
+ __( 'Add New', 'wc-admin' )
),
'shop_order' => array(
- array( '/edit.php?post_type=shop_order', __( 'Orders', 'woo-dash' ) ),
- __( 'Edit Order', 'woo-dash' )
+ array( '/edit.php?post_type=shop_order', __( 'Orders', 'wc-admin' ) ),
+ __( 'Edit Order', 'wc-admin' )
),
- 'edit-shop_coupon' => __( 'Coupons', 'woo-dash' ),
+ 'edit-shop_coupon' => __( 'Coupons', 'wc-admin' ),
'add-shop_coupon' => array(
- array( 'edit.php?post_type=shop_coupon', __( 'Coupons', 'woo-dash' ) ),
- __( 'Add New', 'woo-dash' )
+ array( 'edit.php?post_type=shop_coupon', __( 'Coupons', 'wc-admin' ) ),
+ __( 'Add New', 'wc-admin' )
),
'shop_coupon' => array(
- array( 'edit.php?post_type=shop_coupon', __( 'Coupons', 'woo-dash' ) ),
- __( 'Edit Coupon', 'woo-dash' )
+ array( 'edit.php?post_type=shop_coupon', __( 'Coupons', 'wc-admin' ) ),
+ __( 'Edit Coupon', 'wc-admin' )
),
'woocommerce_page_wc-reports' => array(
- array( 'admin.php?page=wc-reports', __( 'Reports', 'woo-dash' ) )
+ array( 'admin.php?page=wc-reports', __( 'Reports', 'wc-admin' ) )
),
'orders-woocommerce_page_wc-reports' => array(
- array( 'admin.php?page=wc-reports', __( 'Reports', 'woo-dash' ) ),
- __( 'Orders', 'woo-dash' )
+ array( 'admin.php?page=wc-reports', __( 'Reports', 'wc-admin' ) ),
+ __( 'Orders', 'wc-admin' )
),
'customers-woocommerce_page_wc-reports' => array(
- array( 'admin.php?page=wc-reports', __( 'Reports', 'woo-dash' ) ),
- __( 'Customers', 'woo-dash' )
+ array( 'admin.php?page=wc-reports', __( 'Reports', 'wc-admin' ) ),
+ __( 'Customers', 'wc-admin' )
),
'stock-woocommerce_page_wc-reports' => array(
- array( 'admin.php?page=wc-reports', __( 'Reports', 'woo-dash' ) ),
- __( 'Stock', 'woo-dash' )
+ array( 'admin.php?page=wc-reports', __( 'Reports', 'wc-admin' ) ),
+ __( 'Stock', 'wc-admin' )
),
'taxes-woocommerce_page_wc-reports' => array(
- array( 'admin.php?page=wc-reports', __( 'Reports', 'woo-dash' ) ),
- __( 'Taxes', 'woo-dash' )
+ array( 'admin.php?page=wc-reports', __( 'Reports', 'wc-admin' ) ),
+ __( 'Taxes', 'wc-admin' )
),
'woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) )
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) )
),
'general-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'General', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'General', 'wc-admin' ),
),
'products-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Products', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Products', 'wc-admin' ),
),
'tax-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Tax', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Tax', 'wc-admin' ),
),
'shipping-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Shipping', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Shipping', 'wc-admin' ),
),
'checkout-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Payments', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Payments', 'wc-admin' ),
),
'email-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Emails', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Emails', 'wc-admin' ),
),
'advanced-woocommerce_page_wc-settings' => array(
- array( 'admin.php?page=wc-settings', __( 'Settings', 'woo-dash' ) ),
- __( 'Advanced', 'woo-dash' ),
+ array( 'admin.php?page=wc-settings', __( 'Settings', 'wc-admin' ) ),
+ __( 'Advanced', 'wc-admin' ),
),
'woocommerce_page_wc-status' => array(
- __( 'Status', 'woo-dash' ),
+ __( 'Status', 'wc-admin' ),
),
'status-woocommerce_page_wc-status' => array(
- array( 'admin.php?page=wc-status', __( 'Status', 'woo-dash' ) ),
- __( 'System Status', 'woo-dash' ),
+ array( 'admin.php?page=wc-status', __( 'Status', 'wc-admin' ) ),
+ __( 'System Status', 'wc-admin' ),
),
'tools-woocommerce_page_wc-status' => array(
- array( 'admin.php?page=wc-status', __( 'Status', 'woo-dash' ) ),
- __( 'Tools', 'woo-dash' ),
+ array( 'admin.php?page=wc-status', __( 'Status', 'wc-admin' ) ),
+ __( 'Tools', 'wc-admin' ),
),
'logs-woocommerce_page_wc-status' => array(
- array( 'admin.php?page=wc-status', __( 'Status', 'woo-dash' ) ),
- __( 'Logs', 'woo-dash' ),
+ array( 'admin.php?page=wc-status', __( 'Status', 'wc-admin' ) ),
+ __( 'Logs', 'wc-admin' ),
),
'connect-woocommerce_page_wc-status' => array(
- array( 'admin.php?page=wc-status', __( 'Status', 'woo-dash' ) ),
- __( 'WooCommerce Services Status', 'woo-dash' ),
+ array( 'admin.php?page=wc-status', __( 'Status', 'wc-admin' ) ),
+ __( 'WooCommerce Services Status', 'wc-admin' ),
),
- 'woocommerce_page_wc-addons' => __( 'Extensions', 'woo-dash' ),
- 'edit-product' => __( 'Products', 'woo-dash' ),
+ 'woocommerce_page_wc-addons' => __( 'Extensions', 'wc-admin' ),
+ 'edit-product' => __( 'Products', 'wc-admin' ),
'product_page_product_importer' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Import', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Import', 'wc-admin' ),
),
'product_page_product_exporter' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Export', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Export', 'wc-admin' ),
),
'add-product' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Add New', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Add New', 'wc-admin' ),
),
'product' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Edit Product', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Edit Product', 'wc-admin' ),
),
'edit-product_cat' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Categories', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Categories', 'wc-admin' ),
),
'edit-product_tag' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Tags', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Tags', 'wc-admin' ),
),
'product_page_product_attributes' => array(
- array( 'edit.php?post_type=product', __( 'Products', 'woo-dash' ) ),
- __( 'Attributes', 'woo-dash' ),
+ array( 'edit.php?post_type=product', __( 'Products', 'wc-admin' ) ),
+ __( 'Attributes', 'wc-admin' ),
),
) );
@@ -197,12 +197,12 @@ function woo_dash_get_embed_breadcrumbs() {
}
/**
- * `woo_dash_get_embed_enabled_screen_ids`, `woo_dash_get_embed_enabled_plugin_screen_ids`,
- * `woo_dash_get_embed_enabled_screen_ids` should be considered temporary functions for the feature plugin.
+ * `wc_admin_get_embed_enabled_screen_ids`, `wc_admin_get_embed_enabled_plugin_screen_ids`,
+ * `wc_admin_get_embed_enabled_screen_ids` should be considered temporary functions for the feature plugin.
* This is separate from WC's screen_id functions so that extensions explictly have to opt-in to the feature plugin.
* TODO When merging to core, we should explore a better API for opting into the new header for extensions.
*/
-function woo_dash_get_embed_enabled_core_screen_ids() {
+function wc_admin_get_embed_enabled_core_screen_ids() {
$screens = array(
'edit-shop_order',
'shop_order',
@@ -223,23 +223,23 @@ function woo_dash_get_embed_enabled_core_screen_ids() {
'edit-product_tag',
'product_page_product_attributes',
);
- return apply_filters( 'woo_dash_get_embed_enabled_core_screens_ids', $screens );
+ return apply_filters( 'wc_admin_get_embed_enabled_core_screens_ids', $screens );
}
/**
* If any extensions want to show the new header, they can register their screen ids.
* Separate so extensions can register support for the feature plugin separately.
*/
-function woo_dash_get_embed_enabled_plugin_screen_ids() {
+function wc_admin_get_embed_enabled_plugin_screen_ids() {
$screens = array();
- return apply_filters( 'woo_dash_get_embed_enabled_plugin_screens_ids', $screens );
+ return apply_filters( 'wc_admin_get_embed_enabled_plugin_screens_ids', $screens );
}
/**
* Returns core and plugin screen IDs for a list of screens the new header should be enabled on.
*/
-function woo_dash_get_embed_enabled_screen_ids() {
- return array_merge( woo_dash_get_embed_enabled_core_screen_ids(), woo_dash_get_embed_enabled_plugin_screen_ids() );
+function wc_admin_get_embed_enabled_screen_ids() {
+ return array_merge( wc_admin_get_embed_enabled_core_screen_ids(), wc_admin_get_embed_enabled_plugin_screen_ids() );
}
/**
@@ -253,7 +253,7 @@ function woo_dash_get_embed_enabled_screen_ids() {
* @type string $symbol Symbol for currency.
* }
*/
-function woo_dash_currency_settings() {
+function wc_admin_currency_settings() {
$code = get_woocommerce_currency();
return apply_filters(
diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json
index 50e1b65d008..a31d0943d1b 100644
--- a/plugins/woocommerce-admin/package-lock.json
+++ b/plugins/woocommerce-admin/package-lock.json
@@ -1,5 +1,5 @@
{
- "name": "woo-dash",
+ "name": "wc-admin",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json
index ceef9622788..18a335376f8 100755
--- a/plugins/woocommerce-admin/package.json
+++ b/plugins/woocommerce-admin/package.json
@@ -1,5 +1,5 @@
{
- "name": "woo-dash",
+ "name": "wc-admin",
"version": "0.1.0",
"main": "js/index.js",
"author": "Automattic",
@@ -17,7 +17,7 @@
"prestart": "npm run -s install-if-deps-outdated",
"start": "webpack --watch",
"lint": "npm run -s install-if-deps-outdated && eslint client --ext=js,jsx",
- "i18n": "pot-to-php ./languages/woo-dash.pot ./languages/woo-dash.php woo-dash && grunt i18n",
+ "i18n": "pot-to-php ./languages/wc-admin.pot ./languages/wc-admin.php wc-admin && grunt i18n",
"precommit": "npm run -s install-if-no-packages && node bin/pre-commit-hook.js",
"prepush": "npm run -s install-if-no-packages && node bin/pre-push-hook.js",
"pretest": "npm run -s install-if-no-packages",
diff --git a/plugins/woocommerce-admin/phpunit.xml.dist b/plugins/woocommerce-admin/phpunit.xml.dist
index c0bc1b26dfa..24a9cf03281 100644
--- a/plugins/woocommerce-admin/phpunit.xml.dist
+++ b/plugins/woocommerce-admin/phpunit.xml.dist
@@ -10,7 +10,7 @@
syntaxCheck="true"
>
-
+
./tests/
diff --git a/plugins/woocommerce-admin/tests/bootstrap.php b/plugins/woocommerce-admin/tests/bootstrap.php
index d8f7337668e..26d89d60ad5 100755
--- a/plugins/woocommerce-admin/tests/bootstrap.php
+++ b/plugins/woocommerce-admin/tests/bootstrap.php
@@ -2,7 +2,7 @@
/**
* PHPUnit bootstrap file
*
- * @package Woo_Dash
+ * @package WC_Admin
*/
$_tests_dir = getenv( 'WP_TESTS_DIR' );
@@ -24,7 +24,7 @@ require_once $_tests_dir . '/includes/functions.php';
*/
function _manually_load_plugin() {
require dirname( dirname( dirname( __FILE__ ) ) ) . '/gutenberg/gutenberg.php';
- require dirname( dirname( __FILE__ ) ) . '/woo-dash.php';
+ require dirname( dirname( __FILE__ ) ) . '/wc-admin.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
diff --git a/plugins/woocommerce-admin/tests/test-sample.php b/plugins/woocommerce-admin/tests/test-sample.php
index 29aefdc7313..20bb293765b 100755
--- a/plugins/woocommerce-admin/tests/test-sample.php
+++ b/plugins/woocommerce-admin/tests/test-sample.php
@@ -2,7 +2,7 @@
/**
* Class SampleTest
*
- * @package Woo_Dash
+ * @package WC_Admin
*/
/**
diff --git a/plugins/woocommerce-admin/woo-dash.php b/plugins/woocommerce-admin/wc-admin.php
similarity index 59%
rename from plugins/woocommerce-admin/woo-dash.php
rename to plugins/woocommerce-admin/wc-admin.php
index f289577c0a3..bb1cb3bc19a 100755
--- a/plugins/woocommerce-admin/woo-dash.php
+++ b/plugins/woocommerce-admin/wc-admin.php
@@ -1,27 +1,27 @@
Gutenberg and
WooCommerce to be installed and active.', 'woo-dash' ),
+ __( 'The WooCommerce Admin feature plugin requires both
Gutenberg and
WooCommerce to be installed and active.', 'wc-admin' ),
'https://wordpress.org/plugins/gutenberg/',
'https://wordpress.org/plugins/woocommerce/'
);
@@ -31,12 +31,12 @@ function woo_dash_plugins_notice() {
/**
* Set up the plugin, only if we can detect both Gutenberg and WooCommerce
*/
-function woo_dash_plugins_loaded() {
+function wc_admin_plugins_loaded() {
if (
! ( defined( 'GUTENBERG_DEVELOPMENT_MODE' ) || defined( 'GUTENBERG_VERSION' ) ) ||
! class_exists( 'WooCommerce' )
) {
- add_action( 'admin_notices', 'woo_dash_plugins_notice' );
+ add_action( 'admin_notices', 'wc_admin_plugins_notice' );
return;
}
@@ -49,4 +49,4 @@ function woo_dash_plugins_loaded() {
// Create the Admin pages
require_once dirname( __FILE__ ) . '/lib/admin.php';
}
-add_action( 'plugins_loaded', 'woo_dash_plugins_loaded' );
+add_action( 'plugins_loaded', 'wc_admin_plugins_loaded' );