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

Fix $callback type for add_submenu_page #161

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Fix $callback type for add_submenu_page #161

merged 1 commit into from
Feb 13, 2024

Conversation

lipemat
Copy link
Contributor

@lipemat lipemat commented Feb 13, 2024

The default type for $callback is ''. Since there are parameters after $callback, we must support the default as well.

Fixes issue #153

The default type for $callback is ''. Since there are parameters after $callback, we must support the default as well.
@szepeviktor
Copy link
Member

Thank you.

Anyone, please help me review this PR.

@IanDelMar
Copy link
Contributor

https://github.com/WordPress/wordpress-develop/blob/8338c630284124bbe79dc871822d6767e3b45f0b/src/wp-admin/includes/plugin.php#L1477-L1479

if ( ! empty( $callback ) && ! empty( $hookname ) ) {
	add_action( $hookname, $callback );
}

Looks good to me.

@szepeviktor szepeviktor merged commit 7945595 into php-stubs:master Feb 13, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants