Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook throws PHP warnings #4

Open
yumyo opened this issue Nov 13, 2019 · 3 comments
Open

Hook throws PHP warnings #4

yumyo opened this issue Nov 13, 2019 · 3 comments

Comments

@yumyo
Copy link

yumyo commented Nov 13, 2019

The code example throws the following error:

PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, 
function 'prefix_do_wampum_popup' not found or invalid function name in /app/wp-includes/class-wp-hook.php on line 288

The same applies if using any other naming.

@JiveDig
Copy link
Member

JiveDig commented Nov 13, 2019

prefix_do_wampum_popup is just an example usage. You can't call that callback without also creating the function with the same name.

@yumyo
Copy link
Author

yumyo commented Nov 19, 2019

Not sure I am following @JiveDig,
I am using the complete example from the readme:

add_action( 'wampum_popups', 'prefix_do_wampum_popup' );

function prefix_do_wampum_popup() {

	// Bail if not a single post
	if ( ! is_singular('post') ) {
		return;
	}

	$content = '// Some HTML';

	$args = array(
		'type'	=> 'timed',
		'style'	=> 'slideup',
	);
	wampum_popup( $content, $args );

}

To which function are you referring to?

@JiveDig
Copy link
Member

JiveDig commented Nov 19, 2019

If you use that exact code it should work. That’s exactly how we use it. Do you have that code or a modified version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants