[wp-trac] [WordPress Trac] #63248: PHPDoc for embed_handler_html is misleading
WordPress Trac
noreply at wordpress.org
Tue Apr 8 05:58:49 UTC 2025
#63248: PHPDoc for embed_handler_html is misleading
--------------------------+-----------------------------
Reporter: apermo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Embeds | Version: 2.9
Severity: normal | Keywords: docs
Focuses: |
--------------------------+-----------------------------
{{{#!php
<?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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63248>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list