Make WordPress Core

Changeset 60307


Ignore:
Timestamp:
06/13/2025 06:21:56 PM (9 months ago)
Author:
SergeyBiryukov
Message:

Docs: Correct parameter type for the oembed_dataparse filter.

This commit updates the filter documentation to indicate that it can both take and return a string|false value.

Documentation for functions attached to the filter has been similarly corrected:

  • WP_oEmbed::_strip_newlines()
  • wp_filter_oembed_result()
  • wp_filter_oembed_iframe_title_attribute()

Follow-up to [12153], [25723], [34903], [34974], [44942].

Props justlevine.
See #63268.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-oembed.php

    r59888 r60307  
    740740         * @since 2.9.0
    741741         *
    742          * @param string $return The returned oEmbed HTML.
    743          * @param object $data   A data object result from an oEmbed provider.
    744          * @param string $url    The URL of the content to be embedded.
     742         * @param string|false $return The returned oEmbed HTML, or false on failure.
     743         * @param object       $data   A data object result from an oEmbed provider.
     744         * @param string       $url    The URL of the content to be embedded.
    745745         */
    746746        return apply_filters( 'oembed_dataparse', $return, $data, $url );
     
    753753     * @since 3.0.0
    754754     *
    755      * @param string $html Existing HTML.
    756      * @param object $data Data object from WP_oEmbed::data2html()
    757      * @param string $url The original URL passed to oEmbed.
    758      * @return string Possibly modified $html
     755     * @param string|false $html Existing HTML.
     756     * @param object       $data Data object from WP_oEmbed::data2html()
     757     * @param string       $url The original URL passed to oEmbed.
     758     * @return string|false Possibly modified $html.
    759759     */
    760760    public function _strip_newlines( $html, $data, $url ) {
  • trunk/src/wp-includes/embed.php

    r59700 r60307  
    844844 * @since 5.2.0
    845845 *
    846  * @param string $result The oEmbed HTML result.
    847  * @param object $data   A data object result from an oEmbed provider.
    848  * @param string $url    The URL of the content to be embedded.
    849  * @return string The filtered oEmbed result.
     846 * @param string|false $result The oEmbed HTML result.
     847 * @param object       $data   A data object result from an oEmbed provider.
     848 * @param string       $url    The URL of the content to be embedded.
     849 * @return string|false The filtered oEmbed result.
    850850 */
    851851function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) {
     
    911911 * @since 4.4.0
    912912 *
    913  * @param string $result The oEmbed HTML result.
    914  * @param object $data   A data object result from an oEmbed provider.
    915  * @param string $url    The URL of the content to be embedded.
    916  * @return string The filtered and sanitized oEmbed result.
     913 * @param string|false $result The oEmbed HTML result.
     914 * @param object       $data   A data object result from an oEmbed provider.
     915 * @param string       $url    The URL of the content to be embedded.
     916 * @return string|false The filtered and sanitized oEmbed result.
    917917 */
    918918function wp_filter_oembed_result( $result, $data, $url ) {
Note: See TracChangeset for help on using the changeset viewer.