Opened 14 years ago
Closed 13 years ago
#16688 closed defect (bug) (fixed)
Inconsistent 'the_title' filter
Reported by: | jfarthing84 | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | dev-feedback has-patch |
Focuses: | Cc: |
Description
In most places, 'the_title' filter passes two arguments, the title being filtered and the post ID. This is the desirable situation.
However, there are a few places in core code that do not pass the second argument while utilizing 'the_title' filter. This inconsistency is causing notices from my plugin because it expects the second argument in a callback attached to the filter.
Attachments (3)
Change History (9)
#3
@
13 years ago
- Milestone changed from Awaiting Review to 3.3
For some reason previous_post()
and next_post()
pass the whole $post
object instead of $post->ID
:
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/deprecated.php#L152
Though they are both deprecated, I wonder if that should be fixed too.
Related changeset: [2227]
@
13 years ago
Adds missing ID filter args, amends args in deprecated functions using post object to post ID
#4
@
13 years ago
Well, next_post()
is trying to pass in $nextpost
as the second argument - and that doesn't appear to be defined anywhere in that function. I assume it's supposed to be $post
(and then as per your comment, $post->ID
). Patch attached in case this is decided to be fixed as well, though there will be an obvious backwards compatibility concern.
+1 on this - my plugin is experiencing exactly the same warnings due to this inconsistency. Of the 14 instances of
the_title
filter being applied currently in trunk, two of them don't pass the ID along, which the patch fixes.