Ticket #4893 (new task)

Opened 1 year ago

Last modified 1 year ago

Audit of all filter and action names.

Reported by: westi Assigned to: westi
Priority: normal Milestone: 2.9
Component: General Version:
Severity: normal Keywords: early
Cc:

Description

I think for 2.4 we should do an early audit of all the filters and actions in the core and ensure that they follow the following set of rules:

  1. All names should be unique
  2. All names should be relevant to the calling context
  3. All filters should pass in relevant context information

This should then ensure plugins can easily filter just the things they want to.

This is to avoid messes like the_title

./wp-includes/post-template.php:        return apply_filters( 'the_title', $title );
./wp-includes/comment.php:      $post_title = apply_filters('the_title', $post->post_title);
./wp-includes/classes.php:              $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . att
ribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a>';
./wp-includes/deprecated.php:           $string .= apply_filters('the_title', $post->post_title, $post);
./wp-includes/deprecated.php:           $string .= apply_filters('the_title', $post->post_title, $nextpost);
./wp-includes/link-template.php:        $title = apply_filters('the_title', $post->post_title, $post);
./wp-includes/link-template.php:        $title = apply_filters('the_title', $post->post_title, $post);
./wp-includes/general-template.php:                                             $text = strip_tags(apply_filters('the_title', $arc_title));

Change History

09/03/07 01:09:11 changed by ryan

I think 'the_title' filters should probably be moved to 'post_title' so we can let sanitize_post apply the filters. All of the places manually applying the_title would then use sanitize_post.

09/13/07 03:59:12 changed by foolswisdom

  • keywords set to early.

09/14/07 07:50:46 changed by westi

Include #4004

12/20/07 07:02:30 changed by darkdragon

  • keywords changed from early to early hunt-sendnext.

Send next?

12/20/07 16:05:04 changed by lloydbudd

  • milestone changed from 2.4 to 2.5.

12/20/07 16:06:51 changed by santosj

  • keywords changed from early hunt-sendnext to early.

thanks