Opened 7 months ago
Closed 7 months ago
#63248 closed defect (bug) (fixed)
PHPDoc for embed_handler_html is misleading
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.8 | Priority: | normal |
| Severity: | normal | Version: | 2.9 |
| Component: | Embeds | Keywords: | docs has-patch commit dev-reviewed fixed-major |
| Focuses: | Cc: |
Description
<?php ( false !== $return ) { /** * Filters the returned embed HTML. * * @since 2.9.0 * * @see WP_Embed::shortcode() * * @param string|false $return The HTML result of the shortcode, or false on failure. * @param string $url The embed URL. * @param array $attr An array of shortcode attributes. */ return apply_filters( 'embed_handler_html', $return, $url, $attr ); }
Similar argument as in #63220, but even easier.
While the documentation suggests that $return can be false or a string, it can't be false, we are testing exactly for that.
This is misleading.
I've checked the whole file's filters this time, all others look good to me, no actions in that file.
PR follows.
Change History (8)
This ticket was mentioned in PR #8661 on WordPress/wordpress-develop by @apermo.
7 months ago
#1
- Keywords has-patch added
7 months ago
#2
Note for reviewers: Hit expand to top once.
You'll see that there is a condition right before the PHPDoc saying false !== $return
#4
@
7 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 60149:
#5
@
7 months ago
- Keywords commit dev-feedback added
- Milestone changed from 6.9 to 6.8
- Resolution fixed deleted
- Status changed from closed to reopened
#6
@
7 months ago
- Keywords dev-reviewed fixed-major added; dev-feedback removed
Marking as ready for 6.8 backport as #63220 was backported last week.
Note: See
TracTickets for help on using
tickets.
docs: Fixed parameter type and descriptions for
embed_handler_htmlfilter.Trac ticket: https://core.trac.wordpress.org/ticket/63248#ticket