Make WordPress Core


Ignore:
Timestamp:
10/26/2019 09:07:10 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Switch more docs over to typed array notation, plus some fixes.

See #48303, #41756

File:
1 edited

Legend:

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

    r46594 r46596  
    10401040         * @since 2.8.0
    10411041         *
    1042          * @param array        $attr       Attributes for the image markup.
     1042         * @param string[]     $attr       Array of attribute values for the image markup, keyed by attribute name.
    10431043         * @param WP_Post      $attachment Image attachment post.
    10441044         * @param string|array $size       Requested size. Image size or array of width and height values
     
    16041604 * @since 2.9.0
    16051605 *
    1606  * @param array $attr Thumbnail attributes including src, class, alt, title.
    1607  * @return array Modified array of attributes including the new 'wp-post-image' class.
     1606 * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
     1607 * @return string[] Modified array of attributes including the new 'wp-post-image' class.
    16081608 */
    16091609function _wp_post_thumbnail_class_filter( $attr ) {
     
    16191619 * @since 2.9.0
    16201620 *
    1621  * @param array $attr Thumbnail attributes including src, class, alt, title.
     1621 * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
    16221622 */
    16231623function _wp_post_thumbnail_class_filter_add( $attr ) {
     
    16321632 * @since 2.9.0
    16331633 *
    1634  * @param array $attr Thumbnail attributes including src, class, alt, title.
     1634 * @param string[] $attr Array of thumbnail attributes including src, class, alt, title, keyed by attribute name.
    16351635 */
    16361636function _wp_post_thumbnail_class_filter_remove( $attr ) {
     
    24172417 * @since 3.6.0
    24182418 *
    2419  * @return array Supported audio formats.
     2419 * @return string[] Supported audio formats.
    24202420 */
    24212421function wp_get_audio_extensions() {
     
    24252425     * @since 3.6.0
    24262426     *
    2427      * @param array $extensions An array of supported audio formats. Defaults are
    2428      *                          'mp3', 'ogg', 'flac', 'm4a', 'wav'.
     2427     * @param string[] $extensions An array of supported audio formats. Defaults are
     2428     *                            'mp3', 'ogg', 'flac', 'm4a', 'wav'.
    24292429     */
    24302430    return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );
     
    26652665 * @since 3.6.0
    26662666 *
    2667  * @return array List of supported video formats.
     2667 * @return string[] List of supported video formats.
    26682668 */
    26692669function wp_get_video_extensions() {
     
    26732673     * @since 3.6.0
    26742674     *
    2675      * @param array $extensions An array of supported video formats. Defaults are
    2676      *                          'mp4', 'm4v', 'webm', 'ogv', 'flv'.
     2675     * @param string[] $extensions An array of supported video formats. Defaults are
     2676     *                             'mp4', 'm4v', 'webm', 'ogv', 'flv'.
    26772677     */
    26782678    return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
     
    32673267     * @since 3.5.0
    32683268     *
    3269      * @param array $image_editors List of available image editors. Defaults are
    3270      *                             'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'.
     3269     * @param string[] $image_editors Array of available image editor class names. Defaults are
     3270     *                                'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'.
    32713271     */
    32723272    $implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );
     
    39843984     * @since 3.5.0
    39853985     *
    3986      * @param array   $strings List of media view strings.
    3987      * @param WP_Post $post    Post object.
     3986     * @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
     3987     * @param WP_Post  $post    Post object.
    39883988     */
    39893989    $strings = apply_filters( 'media_view_strings', $strings, $post );
     
    40254025 * @param string      $type Mime type.
    40264026 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
    4027  * @return array Found attachments.
     4027 * @return WP_Post[] Array of media attached to the given post.
    40284028 */
    40294029function get_attached_media( $type, $post = 0 ) {
     
    40614061     * @since 3.6.0
    40624062     *
    4063      * @param array   $children Associative array of media attached to the given post.
    4064      * @param string  $type     Mime type of the media desired.
    4065      * @param WP_Post $post     Post object.
     4063     * @param WP_Post[] $children Array of media attached to the given post.
     4064     * @param string    $type     Mime type of the media desired.
     4065     * @param WP_Post   $post     Post object.
    40664066     */
    40674067    return (array) apply_filters( 'get_attached_media', $children, $type, $post );
     
    40734073 * @since 3.6.0
    40744074 *
    4075  * @param string $content A string which might contain media data.
    4076  * @param array $types   An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.
    4077  * @return array A list of found HTML media embeds.
     4075 * @param string   $content A string of HTML which might contain media elements.
     4076 * @param string[] $types   An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.
     4077 * @return string[] Array of found HTML media elements.
    40784078 */
    40794079function get_media_embedded_in_content( $content, $types = null ) {
     
    40854085     * @since 4.2.0
    40864086     *
    4087      * @param array $allowed_media_types An array of allowed media types. Default media types are
    4088      *                                   'audio', 'video', 'object', 'embed', and 'iframe'.
     4087     * @param string[] $allowed_media_types An array of allowed media types. Default media types are
     4088     *                                      'audio', 'video', 'object', 'embed', and 'iframe'.
    40894089     */
    40904090    $allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );
     
    43274327 * Registers the personal data exporter for media.
    43284328 *
    4329  * @param array   $exporters   An array of personal data exporters.
    4330  * @return array  An array of personal data exporters.
     4329 * @param array[] $exporters An array of personal data exporters, keyed by their ID.
     4330 * @return array[] Updated array of personal data exporters.
    43314331 */
    43324332function wp_register_media_personal_data_exporter( $exporters ) {
Note: See TracChangeset for help on using the changeset viewer.