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
This commit is contained in:
Ben Goldsworthy 2021-04-14 22:47:44 +01:00
parent e76a4e0bb1
commit b824a44541
5 changed files with 7 additions and 7 deletions

View file

@ -12,7 +12,7 @@ cp -t dist/img img/fn-wysiwyg.png img/main-menu.png
echo "Copying files..." 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 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..." 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." echo "Production flag set."
# TODO: once automatic minification is implemented, this should handle that. # TODO: once automatic minification is implemented, this should handle that.

View file

@ -213,12 +213,12 @@ abstract class MCI_Footnotes_Layout_Engine {
*/ */
wp_register_style( wp_register_style(
'mci-footnotes-admin', '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(), array(),
( C_BOOL_CSS_PRODUCTION_MODE ) ? C_STR_PACKAGE_VERSION : filemtime( ( PRODUCTION_ENV ) ? C_STR_PACKAGE_VERSION : filemtime(
plugin_dir_path( plugin_dir_path(
dirname( __FILE__ ) dirname( __FILE__ )
) . 'css/settings' . ( ( C_BOOL_CSS_PRODUCTION_MODE ) ? '.min' : '' ) . '.css' ) . 'css/settings' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.css'
) )
); );

View file

@ -339,7 +339,7 @@ class MCI_Footnotes {
* The Boolean may be set at the bottom of the plugins main PHP file. * The Boolean may be set at the bottom of the plugins main PHP file.
* @see footnotes.php * @see footnotes.php
*/ */
if ( C_BOOL_CSS_PRODUCTION_MODE ) { if ( PRODUCTION_ENV ) {
/** /**
* Enqueues a minified united external stylesheet in production. * Enqueues a minified united external stylesheet in production.

View file

@ -211,7 +211,7 @@ abstract class MCI_Footnotes_Layout_Engine {
* automated update of version number for cache busting. * automated update of version number for cache busting.
* No need to use '-styles' in the handle, as '-css' is appended automatically. * 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 ); wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.min.css' ), array(), C_STR_PACKAGE_VERSION );

View file

@ -103,4 +103,4 @@ $g_obj_mci_footnotes->run();
* Developing stylesheets is meant to be easier when this is set to false. * 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. * WARNING: This facility designed for development must NOT be used in production.
*/ */
define( 'C_BOOL_CSS_PRODUCTION_MODE', false ); define( 'PRODUCTION_ENV', false );