#9286 closed enhancement (fixed)
bp_get_blog_latest_post not applying filters properly
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 14.5.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Blogs | Keywords: | has-patch reporter-feedback needs-testing |
| Cc: | emaralive, pratiklondhe, rollybueno |
Description
The function
bp_get_blog_latest_post does this on line 763
apply_filters( 'the_title', $retval )
However if you look at the documentation of that filter:
https://developer.wordpress.org/reference/hooks/the_title/
You will see that the there are two parameters $post_title and $post_id and both are mandatory, so that any plugin that adds this filter and follows the documentation strictly will cause a fatal error
Can this be fixed asap please?
Change History (10)
This ticket was mentioned in PR #411 on buddypress/buddypress by @rollybueno.
12 months ago
#3
- Keywords has-patch added
This ticket was mentioned in Slack in #buddypress by rollybueno. View the logs.
12 months ago
#6
@
5 months ago
- Component changed from Core to Blogs
- Milestone changed from Awaiting Review to 14.5.0
- Type changed from defect (bug) to enhancement
Reported on https://buddypress.trac.wordpress.org/ticket/9286, the bp_get_blog_latest_post() will be using the_title filters but only provided 1 out of 2 required params
The patch includes creating new function called bp_get_blog_latest_post_id() which is just a copy of bp_get_blog_latest_post_title(), except it will return latest post ID instead of title.
Then we use this for the required param on the_title filters as per documentation: https://developer.wordpress.org/reference/hooks/the_title/
Ticket: https://buddypress.trac.wordpress.org/ticket/9286
Filter docs: https://developer.wordpress.org/reference/hooks/the_title/
Trac ticket: https://buddypress.trac.wordpress.org/ticket/9286