You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a small issue trying to set up functions in class-plugin-theme-public.php that has a default parameter. I'm not sure if this is a Wordpress issue, a Boilerplate issue, or just me not understanding the do_action method. What happens is I define a function like this:
public function plugin_contact_info( $show_logo=true ) {
var_dump( $show_logo );
}
Then inside the class-plugin-theme.php's define_public_hooks method I call:
I would expect a the var_dump to be bool(true), but what I am getting is: string(0) ""
So my question is WHY?
It doesn't seem to be accepting the default as set in my function, or more specifically, the do_action call ALWAYS seems to pass blank as the first parameter if one is not defined in the call. Is this standard for Wordpress? Why would it not pass NULL?
The text was updated successfully, but these errors were encountered:
I'm having a small issue trying to set up functions in
class-plugin-theme-public.php
that has a default parameter. I'm not sure if this is a Wordpress issue, a Boilerplate issue, or just me not understanding thedo_action
method. What happens is I define a function like this:Then inside the
class-plugin-theme.php
'sdefine_public_hooks
method I call:Finally when I call the do_action like this:
do_action('show_plugin_contact_info');
I would expect a the
var_dump
to bebool(true)
, but what I am getting is:string(0) ""
So my question is WHY?
It doesn't seem to be accepting the default as set in my function, or more specifically, the
do_action
call ALWAYS seems to pass blank as the first parameter if one is not defined in the call. Is this standard for Wordpress? Why would it not pass NULL?The text was updated successfully, but these errors were encountered: