Make WordPress Core

Changeset 49626


Ignore:
Timestamp:
11/17/2020 10:09:12 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document the $args parameter of wp_oembed_get().

Link to wp_oembed_get() as the canonical source when documenting additional arguments in various WP_oEmbed methods.

Follow-up to [49620].

See #51269.

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

Legend:

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

    r49620 r49626  
    239239         * @param string       $url  The URL to the content.
    240240         * @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.
     241         *     Optional. Additional provider arguments. Default empty.
     242         *
     243         *     @type bool $discover Optional. Determines whether to attempt to discover link tags
     244         *                          at the given URL for an oEmbed provider when the provider URL
     245         *                          is not found in the built-in providers list. Default true.
    246246         * }
    247247         * @return string|false The oEmbed provider URL on success, false on failure.
    … …  
    335335         *
    336336         * @param string       $url  The URL to the content that should be attempted to be embedded.
    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          * }
     337         * @param string|array $args Optional. Additional arguments for retrieving embed HTML.
     338         *                           See wp_oembed_get() for accepted arguments. Default empty.
    346339         * @return object|false The result in the form of an object on success, false on failure.
    347340         */
    … …  
    373366         *
    374367         * @param string       $url  The URL to the content that should be attempted to be embedded.
    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          * }
     368         * @param string|array $args Optional. Additional arguments for retrieving embed HTML.
     369         *                           See wp_oembed_get() for accepted arguments. Default empty.
    384370         * @return string|false The UNSANITIZED (and potentially unsafe) HTML that should be used to embed
    385371         *                      on success, false on failure.
    … …  
    400386                 *                             Default null to continue retrieving the result.
    401387                 * @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                  * }
     388                 * @param string|array $args   Optional. Additional arguments for retrieving embed HTML.
     389                 *                             See wp_oembed_get() for accepted arguments. Default empty.
    411390                 */
    412391                $pre = apply_filters( 'pre_oembed_result', null, $url, $args );
    … …  
    429408                 * @param string|false $data The returned oEmbed HTML (false if unsafe).
    430409                 * @param string       $url  URL of the content to be embedded.
    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                  * }
     410                 * @param string|array $args Optional. Additional arguments for retrieving embed HTML.
     411                 *                           See wp_oembed_get() for accepted arguments. Default empty.
    440412                 */
    441413                return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
    … …  
    539511         * @param string       $provider The URL to the oEmbed provider.
    540512         * @param string       $url      The URL to the content that is desired to be embedded.
    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          * }
     513         * @param string|array $args     Optional. Additional arguments for retrieving embed HTML.
     514         *                               See wp_oembed_get() for accepted arguments. Default empty.
    550515         * @return object|false The result in the form of an object on success, false on failure.
    551516         */
    … …  
    564529                 * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs.
    565530                 *
    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                  * }
     531                 * @param string $provider URL of the oEmbed provider.
     532                 * @param string $url      URL of the content to be embedded.
     533                 * @param array  $args     Optional. Additional arguments for retrieving embed HTML.
     534                 *                         See wp_oembed_get() for accepted arguments. Default empty.
    577535                 */
    578536                $provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );
  • trunk/src/wp-includes/embed.php

    r49383 r49626  
    100100 *
    101101 * @param string $url  The URL that should be embedded.
    102  * @param array  $args Optional. Additional arguments and parameters for retrieving embed HTML.
    103  *                     Default empty.
     102 * @param array  $args {
     103 *     Optional. Additional arguments for retrieving embed HTML. Default empty.
     104 *
     105 *     @type int|string $width    Optional. The `maxwidth` value passed to the provider URL.
     106 *     @type int|string $height   Optional. The `maxheight` value passed to the provider URL.
     107 *     @type bool       $discover Optional. Determines whether to attempt to discover link tags
     108 *                                at the given URL for an oEmbed provider when the provider URL
     109 *                                is not found in the built-in providers list. Default true.
     110 * }
    104111 * @return string|false The embed HTML on success, false on failure.
    105112 */
Note: See TracChangeset for help on using the changeset viewer.