[wp-trac] Re: [WordPress Trac] #5770: Add extra options for default tag-cloud widget

WordPress Trac wp-trac at lists.automattic.com
Thu May 14 09:54:51 GMT 2009


#5770: Add extra options for default tag-cloud widget
----------------------------+-----------------------------------------------
  Reporter:  AndrewFrazier  |        Type:  enhancement
    Status:  closed         |    Priority:  normal     
 Milestone:                 |   Component:  Widgets    
   Version:  2.5            |    Severity:  normal     
Resolution:  invalid        |    Keywords:  needs-patch
----------------------------+-----------------------------------------------

Comment(by Denis-de-Bernardy):

 like this:

 add_filter(widget_tag_cloud_args, your_function)

 then, there are two hooks that let you add to the form:


 {{{
                 // filters the widget admin form before displaying, return
 false to stop displaying it
                 $instance = apply_filters('widget_form_callback',
 $instance, $this);

                 $return = null;
                 if ( false !== $instance ) {
                         $return = $this->form($instance);
                         if ( 'noform' !== $return )
                                 do_action_ref_array( 'in_widget_form',
 array(&$this) ); // add extra fields in the widget form
                 }
                 return $return;
 }}}


 and finally, there is a two hook that let you fetch the options that were
 sent:

 {{{
         $instance = apply_filters('widget_update_callback', $instance,
 $new_instance, $this);
         if ( false !== $instance )
                 $all_instances[$number] = $instance;
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/5770#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list