I'm building a plugin for Wordpress and need to define constants. I created some constants in my plugin base file which work just fine. e.g.:
if(!defined('SIMleague_pluginName')){
define('SIMleague_pluginName', 'SIM League');
}
Now I'm trying to add more constants:
if(!defined('SIMleague_active')){
define('SIMleague_active', 'activated');
}
I just keep getting these errors for every constant I define:
Warning: Use of undefined constant ....
I'm I missing something? I tried to add multiple constants. Even copied the first one and changed the constant name and value to make sure I made no typo's. But still no luck ...
As debug code I use:
<br/><p><?php echo SIMleague_active ?></p>
<br/><p><?php echo SIMleague_pluginName ?></p>
First One gives an error, the second line works just fine.
Can someone explain this behavior?
ADDED (full error message):
Warning: Use of undefined constant SIMleague_active - assumed 'SIMleague_active' (this will throw an Error in a future version of PHP) in /volume1/web/esportstest/wp-content/plugins/SIMleague/classes/SIMleague_Admin_Settings.php on line 65 Call Stack: 0.0001 409912 1. {main}() /volume1/web/esportstest/wp-admin/admin.php:0 0.3584 9152128 2. do_action() /volume1/web/esportstest/wp-admin/admin.php:254 0.3585 9152504 3. WP_Hook->do_action() /volume1/web/esportstest/wp-includes/plugin.php:478 0.3585 9152504 4. WP_Hook->apply_filters() /volume1/web/esportstest/wp-includes/class-wp-hook.php:311 0.3585 9153632 5. SIMleague_Admin::my_plugin_options() /volume1/web/esportstest/wp-includes/class-wp-hook.php:287 0.3586 9153632 6. SIMleague_Admin::renderBasePage() /volume1/web/esportstest/wp-content/plugins/SIMleague/classes/SIMleague_Admin.php:27 0.3586 9153696 7. SIMleague_Admin_Settings::renderSettings() /volume1/web/esportstest/wp-content/plugins/SIMleague/classes/SIMleague_Admin.php:59 SIMleague_active
Both constants are defined following eachother in SIMleague.php and used in SIMleague_Admin_Settings (SIMleague_Admin_Settings extends SIMleague_Admin class)