From b824a44541644885054839e5238eb2de3c7f9acc Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Wed, 14 Apr 2021 22:47:44 +0100 Subject: [PATCH] style: rename production flag variable Renames the current production flag variable to be shorter, non-Hungarian (presaging changes to come in #35) and not specifically CSS_-related. See #80 --- _tools/build.sh | 2 +- class/dashboard/layout.php | 6 +++--- class/init.php | 2 +- class/layout/abstract-engine.php | 2 +- footnotes.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_tools/build.sh b/_tools/build.sh index e4b908b..aa89c41 100755 --- a/_tools/build.sh +++ b/_tools/build.sh @@ -12,7 +12,7 @@ cp -t dist/img img/fn-wysiwyg.png img/main-menu.png echo "Copying files..." cp -t dist features.txt license.txt readme.txt includes.php wpml-config.xml customized-documentation-schema.txt customized-template-stack.txt CONTRIBUTING.md README.md SECURITY.md echo "Setting production flag..." -sed "s/'C_BOOL_CSS_PRODUCTION_MODE', false/'C_BOOL_CSS_PRODUCTION_MODE', true/g" footnotes.php > dist/footnotes.php +sed "s/'PRODUCTION_ENV', false/'PRODUCTION_ENV', true/g" footnotes.php > dist/footnotes.php echo "Production flag set." # TODO: once automatic minification is implemented, this should handle that. diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index a38b88a..61c9934 100644 --- a/class/dashboard/layout.php +++ b/class/dashboard/layout.php @@ -213,12 +213,12 @@ abstract class MCI_Footnotes_Layout_Engine { */ wp_register_style( 'mci-footnotes-admin', - plugins_url( 'footnotes/css/settings' . ( ( C_BOOL_CSS_PRODUCTION_MODE ) ? '.min' : '' ) . '.css' ), + plugins_url( 'footnotes/css/settings' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.css' ), array(), - ( C_BOOL_CSS_PRODUCTION_MODE ) ? C_STR_PACKAGE_VERSION : filemtime( + ( PRODUCTION_ENV ) ? C_STR_PACKAGE_VERSION : filemtime( plugin_dir_path( dirname( __FILE__ ) - ) . 'css/settings' . ( ( C_BOOL_CSS_PRODUCTION_MODE ) ? '.min' : '' ) . '.css' + ) . 'css/settings' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.css' ) ); diff --git a/class/init.php b/class/init.php index 6e70d9c..5939040 100644 --- a/class/init.php +++ b/class/init.php @@ -339,7 +339,7 @@ class MCI_Footnotes { * The Boolean may be set at the bottom of the plugin’s main PHP file. * @see footnotes.php */ - if ( C_BOOL_CSS_PRODUCTION_MODE ) { + if ( PRODUCTION_ENV ) { /** * Enqueues a minified united external stylesheet in production. diff --git a/class/layout/abstract-engine.php b/class/layout/abstract-engine.php index 143ad96..b1826e6 100644 --- a/class/layout/abstract-engine.php +++ b/class/layout/abstract-engine.php @@ -211,7 +211,7 @@ abstract class MCI_Footnotes_Layout_Engine { * automated update of version number for cache busting. * No need to use '-styles' in the handle, as '-css' is appended automatically. */ - if ( true === C_BOOL_CSS_PRODUCTION_MODE ) { + if ( true === PRODUCTION_ENV ) { wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.min.css' ), array(), C_STR_PACKAGE_VERSION ); diff --git a/footnotes.php b/footnotes.php index 5917208..b6ab661 100755 --- a/footnotes.php +++ b/footnotes.php @@ -103,4 +103,4 @@ $g_obj_mci_footnotes->run(); * Developing stylesheets is meant to be easier when this is set to false. * WARNING: This facility designed for development must NOT be used in production. */ -define( 'C_BOOL_CSS_PRODUCTION_MODE', false ); +define( 'PRODUCTION_ENV', false );