[wp-trac] [WordPress Trac] #25368: Add temp hooks for Widgets UI Refresh plugin-as-feature

WordPress Trac noreply at wordpress.org
Thu Jan 2 21:48:16 UTC 2014


#25368: Add temp hooks for Widgets UI Refresh plugin-as-feature
-------------------------------------+-----------------------
 Reporter:  westonruter              |       Owner:  nacin
     Type:  enhancement              |      Status:  reopened
 Priority:  normal                   |   Milestone:  3.9
Component:  Widgets                  |     Version:  3.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch docs-feedback  |
-------------------------------------+-----------------------

Comment (by westonruter):

 Replying to [comment:12 DrewAPicture]:
 > [attachment:25368.patch] is a comprehensive second pass of the hook
 docs. Things started to get a little murky with the `dynamic_sidebar` hook
 so feel free to comment with any changes.

 Regarding `@type array|string $callback` should the type just be
 `callable`? It could be a closure as well.

 And then the `$params` is actually wrapped in another array, so I think
 the docs should be something like:

 {{{
 @type array   $params {
         Array of arrays to pass into the widget callback, as the second
 argument to call_user_func_array

         @type array {
                 An array of multi-widget arguments.

                 @type int $number Number increment used for multiples of
 the same widget.
         }
 }
 }}}

 Here's a dump of an example registered widget:

 {{{
 Array
 (
     [name] => Text
     [id] => text-54
     [callback] => Array
         (
             [0] => WP_Widget_Text Object
                 (
                     [id_base] => text
                     [name] => Text
                     [widget_options] => Array
                         (
                             [classname] => widget_text
                             [description] => Arbitrary text or HTML.
                         )

                     [control_options] => Array
                         (
                             [id_base] => text
                             [width] => 400
                             [height] => 350
                         )

                     [number] => 62
                     [id] => text-62
                     [updated] =>
                     [option_name] => widget_text
                 )

             [1] => display_callback
         )

     [params] => Array
         (
             [0] => Array
                 (
                     [number] => 54
                 )

         )

     [classname] => widget_text
     [description] => Arbitrary text or HTML.
 )
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25368#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list