Make WordPress Core

Ticket #51269: 51269.3.diff

File 51269.3.diff, 7.8 KB (added by audrasjb, 4 years ago)

patch refreshed against trunk

  • src/wp-includes/class-wp-oembed.php

    diff --git a/src/wp-includes/class-wp-oembed.php b/src/wp-includes/class-wp-oembed.php
    index 9e688fc69e..9ce21d0ce6 100644
    a b class WP_oEmbed { 
    237237         * @see WP_oEmbed::discover()
    238238         *
    239239         * @param string       $url  The URL to the content.
    240          * @param string|array $args Optional provider arguments.
     240         * @param string|array $args {
     241         *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     242         *
     243         *     @type bool $discover Optional. Determines whether to attempt to discover link tags at the given URL
     244         *                          for an oEmbed provider when the oEmbed provider URL is not found in the
     245         *                          built-in providers list.
     246         * }
    241247         * @return string|false The oEmbed provider URL on success, false on failure.
    242248         */
    243249        public function get_provider( $url, $args = '' ) {
    class WP_oEmbed { 
    328334         * @since 4.8.0
    329335         *
    330336         * @param string       $url  The URL to the content that should be attempted to be embedded.
    331          * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty.
     337         * @param string|array $args {
     338         *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     339         *
     340         *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     341         *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     342         *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     343         *                                at the given URL for an oEmbed provider when the oEmbed
     344         *                                provider URL is not found in the built-in providers list.
     345         * }
    332346         * @return object|false The result in the form of an object on success, false on failure.
    333347         */
    334348        public function get_data( $url, $args = '' ) {
    class WP_oEmbed { 
    358372         * @since 2.9.0
    359373         *
    360374         * @param string       $url  The URL to the content that should be attempted to be embedded.
    361          * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty.
    362          * @return string|false The UNSANITIZED (and potentially unsafe) HTML that should be used to embed on success,
    363          *                      false on failure.
     375         * @param string|array $args {
     376         *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     377         *
     378         *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     379         *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     380         *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     381         *                                at the given URL for an oEmbed provider when the oEmbed
     382         *                                provider URL is not found in the built-in providers list.
     383         * }
     384         * @return string|false The UNSANITIZED (and potentially unsafe) HTML that should be used to embed
     385         *                      on success, false on failure.
    364386         */
    365387        public function get_html( $url, $args = '' ) {
    366388                /**
    class WP_oEmbed { 
    374396                 *
    375397                 * @since 4.5.3
    376398                 *
    377                  * @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
    378                  *                            Default null to continue retrieving the result.
    379                  * @param string      $url    The URL to the content that should be attempted to be embedded.
    380                  * @param array       $args   Optional. Arguments, usually passed from a shortcode. Default empty.
     399                 * @param null|string  $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
     400                 *                             Default null to continue retrieving the result.
     401                 * @param string       $url    The URL to the content that should be attempted to be embedded.
     402                 * @param string|array $args   {
     403                 *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     404                 *
     405                 *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     406                 *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     407                 *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     408                 *                                at the given URL for an oEmbed provider when the oEmbed
     409                 *                                provider URL is not found in the built-in providers list.
     410                 * }
    381411                 */
    382412                $pre = apply_filters( 'pre_oembed_result', null, $url, $args );
    383413
    class WP_oEmbed { 
    398428                 *
    399429                 * @param string|false $data The returned oEmbed HTML (false if unsafe).
    400430                 * @param string       $url  URL of the content to be embedded.
    401                  * @param array        $args Optional arguments, usually passed from a shortcode.
     431                 * @param string|array $args {
     432                 *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     433                 *
     434                 *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     435                 *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     436                 *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     437                 *                                at the given URL for an oEmbed provider when the oEmbed
     438                 *                                provider URL is not found in the built-in providers list.
     439                 * }
    402440                 */
    403441                return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
    404442        }
    class WP_oEmbed { 
    500538         *
    501539         * @param string       $provider The URL to the oEmbed provider.
    502540         * @param string       $url      The URL to the content that is desired to be embedded.
    503          * @param array|string $args     Optional. Arguments, usually passed from a shortcode. Default empty.
     541         * @param string|array $args     {
     542         *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     543         *
     544         *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     545         *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     546         *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     547         *                                at the given URL for an oEmbed provider when the oEmbed
     548         *                                provider URL is not found in the built-in providers list.
     549         * }
    504550         * @return object|false The result in the form of an object on success, false on failure.
    505551         */
    506552        public function fetch( $provider, $url, $args = '' ) {
    class WP_oEmbed { 
    517563                 * @since 2.9.0
    518564                 * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs.
    519565                 *
    520                  * @param string $provider URL of the oEmbed provider.
    521                  * @param string $url      URL of the content to be embedded.
    522                  * @param array  $args     Optional arguments, usually passed from a shortcode.
     566                 * @param string $provider       URL of the oEmbed provider.
     567                 * @param string $url            URL of the content to be embedded.
     568                 * @param string|array $args     {
     569                 *     Optional. Additional arguments and parameters for retrieving embed HTML. Default empty.
     570                 *
     571                 *     @type int|string $width    Optional. The "maxwidth" value passed to the provider URL.
     572                 *     @type int|string $height   Optional. The "maxheight" value passed to the provider URL.
     573                 *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     574                 *                                at the given URL for an oEmbed provider when the oEmbed
     575                 *                                provider URL is not found in the built-in providers list.
     576                 * }
    523577                 */
    524578                $provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );
    525579