It’s possible that your $http_host isn’t in the list of possible choices. You can always check first that the ENVIRONMENT constant has actually been defined:
if ( defined( 'ENVIRONMENT' ) && 'local' === ENVIRONMENT ) {
define('ASSETSDIR', get_template_directory_uri() . '/assets');
} else {
define('ASSETSDIR', $dist_dir . '/assets');
}
Related Posts:
- Should I use spl_autoload_register() in my plugin?
- WP-CLI – Selecting PHP version
- error_log() output for print_r() appearing on page
- Hide php Notices in Dashboard
- PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- WSOD but WP_DEBUG not giving any errors
- get_the_content if it contains multiple lines it results in SyntaxError
- How to resolve error “Cookies are blocked due to unexpected output.”?
- error_log is not working as expected in functions.php file
- Enable errors PHP WordPress 5.2
- “Can’t use function return value in write context” error
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- “Notice: Undefined variable: content” is showing [closed]
- After upgrading to PHP 7.0 my contact form outputs error
- Does WordPress have a built in reference to the PHP version its running under? [closed]
- Can WordPress email the admin about PHP errors, while hiding them from the site?
- White Screen of Death – wp-admin
- Ajax return code 400
- Accessing site’s root from themes folder
- WordPress 5 WP REST routes – No errors
- How to find error in my code when the error message is pointing to WP core file?
- get_term_link() returns correct – But illogical error-messages disturb
- Calling directories to load in wordpress
- PHP Warning: Attempt to read property “term_id” on bool
- Mute Debug Messages from Plugins
- Error on wp_default_style After upgrade to php 7
- Headers already sent in Pluggable.php / homepage and wp-login error
- Which is the correct way to conditionally enqueue a CSS file?
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- Preg_Match(): compilation failed unknown property name
- Warning: Illegal string offset on theme options page [closed]
- PHP if statement works in template files, but not header
- Errors after upgrading PHP to 7.4 WordPress
- PHP-warning in post-template.php and no loading content on pages
- How to end a while loop when used in a fetch assoc function [closed]
- Parse error: syntax error, unexpected ‘}’ [closed]
- Array to string conversion error in PHP 7.2 when returning user role as class
- javascript variable to wordpress php variable
- PHP E_WARNING being shown despite php.ini [closed]
- What’s wrong with this piece of code? [closed]
- can’t get errors
- Angular not defined [closed]
- Cannot load media and I get “PHP Warning: Invalid argument supplied for foreach(“
- Fatal Error wp-settings.php on line 119
- How can I fix this code [duplicate]
- Trying to display terms from custom taxonomy within function
- Too many errors on log
- Programmatically revert to backup .htaccess a possibility?
- Prevent post from being published and show error
- Can’t log in to WordPress wp-admin after adding code to functions.php
- White screen after migrating site, but wp-admin works fine. Disabling all plugins, applying default theme and enabling debug mode does nothing
- Fatal error login WordPress [duplicate]
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- WordPress Bad Request Error 400
- HELP: cannot log into wordpress. PHP error
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) on single.php
- The link you followed has expired. Please try again
- PHP error on local server install
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Site title not showing. Please help me
- Getting an empty space in up sell items
- This occurs when I open admin or front on localhost
- Is there a way to search for a missing endif?
- style.min.css code issue
- PHP is_embed error showing up
- How to send logs to plugin owner for a plugin?
- global $post inside plugin query messes up every new post page in wp-admin
- Headers Already Sent
- Functions are causing errors
- Too few arguments for printf() [closed]
- syntax error unexpected ‘}’ at 364 line
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- WordPress won’t display errors at all
- Troubleshooting “loopback requests that take too long”
- Data inserted in database, but ajax calls error function
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Query Concatenation
- WP Debug enabled Undefined index error in a widget
- php 7.0 update to 7.1 and at least 7.2
- How to handle PHP parse errors?
- PHP warning Invalid argument supplied for foreach() on custom page template
- WordPress White Screen Error
- Not able to see the error [closed]
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- kali php problem [closed]
- PHP warning: Undefined array key 2 in feed.php
- Getting invalid user ID error when creating a new user with wp_insert_user
- Execute multiple PHP Snippets causes error?
- WordPress 6.1.1 shows deprecated errors with PHP 8.1 & 8.2
- I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
- Error when loading Dashboard
- WordPress @include( ‘template-config.php’ );
- “Unexpected response from server” error when trying to upload any .mp4 file over 100MB
- Site Health and PHP 8.1
- Undefined constant ABSPATH
- PHP Warning: Undefined array key “VirtualHostSubMenu” in index.php
- Warning: Undefined variable $post_id
- There has been a critical error on this website – wordpress issue after upgrading PHP