I have theses errors in php v7.2
but don\'t see any E_WARNING
when using php v7.1
.
How can I resolve following errors?
In addition, for those who are new to wordpress Plugin development and cant seem to figure out what it means to define "Constant" before its used...
Here is an example of what will throw an error:
add_action('wp_enqueue_scripts', myprefix_load_styles);
Declaring a function directly like that in a hook is one way to generate an error like this. Instead:
add_action('wp_enqueue_scripts', 'myprefix_load_styles');
Note, the function name is now inside the quotes. And that should work, if thats your scenario.