[wp-trac] [WordPress Trac] #18236: Change hook 'post_edit_form_tag' from an action to a filter

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 29 04:10:47 UTC 2011


#18236: Change hook 'post_edit_form_tag' from an action to a filter
--------------------------+------------------------------
 Reporter:  mikeschinkel  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Upload        |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------
Changes (by dd32):

 * keywords:  has-patch dev-feedback => dev-feedback


Comment:

 > If the action returns null then the echo echos nothing.

 Unless the filter has both an action AND a filter attached.
 Eg:
 {{{
 add_filter('filter', function($s) { return $s . '1'; });
 add_action('filter', function() { echo '2'; });
 add_filter('filter', function($s) { return $s . '3'; });

 echo apply_filters('filter', '');
 }}}

 echo's `'23'`, the 2 from the action, and 3 from the 3rd filter, the 1
 from the first filter has been null'ed as the return value of the action
 is NULL and has overridden the 1.

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


More information about the wp-trac mailing list