Skip to content

Registering Shortcode tutorial bug #20

@PeteBat

Description

@PeteBat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions