[wp-trac] [WordPress Trac] #54871: Specify which params are required in add_shortcode callback

WordPress Trac noreply at wordpress.org
Thu Apr 6 13:04:24 UTC 2023


#54871: Specify which params are required in add_shortcode callback
-------------------------+----------------------
 Reporter:  mkarimzada   |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Shortcodes   |     Version:  5.8.3
 Severity:  trivial      |  Resolution:  invalid
 Keywords:  php80 close  |     Focuses:  docs
-------------------------+----------------------
Changes (by hellofromTonya):

 * keywords:  php8 close => php80 close
 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hello @mkarimzada,

 >it's not clear which parameters are required for add_shortcode $callback
 function.

 [comment:2 As @jrf noted], the function's docblock provides you with that
 information and
 [https://developer.wordpress.org/reference/functions/add_shortcode/#more-
 information there's more information available in the Developer
 Resources].

 I've closed this ticket. Why? It's been a close candidate for 15 months
 with no additional follow-up. The docs and resources do clearly identify
 that "Every shortcode callback is passed three parameters by default" and
 what those parameters are.

 However, please reopen if there is more to consider that could help to
 further clarify documentation needs.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54871#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list