Make WordPress Core

Opened 8 years ago

Closed 21 months ago

Last modified 21 months ago

#4893 closed enhancement (invalid)

Audit of all filter and action names.

Reported by: westi Owned by: westi
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:


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 (15)

comment:1 @ryan8 years ago

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.

comment:2 @foolswisdom8 years ago

  • Keywords early added

comment:3 @westi8 years ago

Include #4004

comment:4 @darkdragon8 years ago

  • Keywords hunt-sendnext added

Send next?

comment:5 @lloydbudd8 years ago

  • Milestone changed from 2.4 to 2.5

comment:6 @santosj8 years ago

  • Keywords hunt-sendnext removed


comment:7 @Denis-de-Bernardy6 years ago

  • Component changed from General to Plugins

shouldn't we close this? as in, it's too late?

comment:8 @Denis-de-Bernardy6 years ago

this ticket makes the early keyword seem very laughable. :D

comment:9 @hakre6 years ago

Versus: #4152

comment:10 @ryan6 years ago

  • Milestone changed from 2.9 to Future Release

comment:11 @ptahdunbar6 years ago

3.0 seems like a good time to review this ticket

comment:12 @scribu6 years ago

  • Keywords early removed
  • Type changed from task (blessed) to enhancement

comment:13 @nacin21 months ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

This has sailed a dozen times around the world by now. Closing. New tickets for specific issues.

comment:14 @ircbot21 months ago

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.

comment:15 @SergeyBiryukov21 months ago

the_title argument inconsistencies were handled in #13558 and #16688.

Note: See TracTickets for help on using tickets.