Skip to content

Commit

Permalink
style: rename production flag variable
Browse files Browse the repository at this point in the history
Renames the current production flag variable to be shorter,
non-Hungarian (presaging changes to come in #35) and not specifically
CSS_-related.

See #80
  • Loading branch information
Rumperuu committed Apr 14, 2021
1 parent e76a4e0 commit b824a44
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions class/dashboard/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ private function append_scripts() {
*/
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'
)
);

Expand Down
2 changes: 1 addition & 1 deletion class/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function register_public() {
* 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.
Expand Down
2 changes: 1 addition & 1 deletion class/layout/abstract-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private function append_scripts() {
* 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 );

Expand Down
2 changes: 1 addition & 1 deletion footnotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@
* 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 );

0 comments on commit b824a44

Please sign in to comment.