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

Registering Shortcode tutorial bug #20

Open
PeteBat opened this issue Aug 5, 2024 · 0 comments
Open

Registering Shortcode tutorial bug #20

PeteBat opened this issue Aug 5, 2024 · 0 comments

Comments

@PeteBat
Copy link

PeteBat commented Aug 5, 2024

add_shortcut() only accepts 2 arguments/parameters

add_shortcode( string $tag, callable $callback );

Tutorial has 4 arguments

foreach ( $this->shortcodes as $hook ) {
        add_shortcode(  $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
}

add_action(...) or addfilter(...) lines above it were probably copied/pasted which has 4 and changed to add_shortcode( but add_shortcode() only has 2

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

1 participant