Opened 6 years ago
Last modified 3 years ago
#4893 new enhancement
Audit of all filter and action names.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Plugins | Version: | |
| Severity: | normal | Keywords: | |
| 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:
- All names should be unique
- All names should be relevant to the calling context
- 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 (12)
comment:2
foolswisdom — 6 years ago
- Keywords early added
- Component changed from General to Plugins
shouldn't we close this? as in, it's too late?
this ticket makes the early keyword seem very laughable. :D
comment:10
ryan — 4 years ago
- Milestone changed from 2.9 to Future Release
comment:11
ptahdunbar — 3 years ago
3.0 seems like a good time to review this ticket
comment:12
scribu — 3 years ago
- Keywords early removed
- Type changed from task (blessed) to enhancement
Note: See
TracTickets for help on using
tickets.

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.