Changeset 32609 for trunk/src/wp-includes/media.php
- Timestamp:
- 05/26/2015 07:22:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r32113 r32609 26 26 * 27 27 * @since 2.5.0 28 * 29 * @global int $content_width 30 * @global array $_wp_additional_image_sizes 28 31 * 29 32 * @param int $width Width of the image in pixels. … … 146 149 * @param array|string $size Optional. Image size to scale to. Accepts a registered image size 147 150 * or flat array of height and width values. Default 'medium'. 148 * @return bool|array False on failure, array on success.151 * @return false|array False on failure, array on success. 149 152 */ 150 153 function image_downsize( $id, $size = 'medium' ) { … … 243 246 * @since 3.9.0 244 247 * 248 * @global array $_wp_additional_image_sizes 249 * 245 250 * @param string $name The image size to check. 246 251 * @return bool True if the image size exists, false if not. … … 256 261 * 257 262 * @since 3.9.0 263 * 264 * @global array $_wp_additional_image_sizes 258 265 * 259 266 * @param string $name The image size to remove. … … 344 351 * @param string $size Optional. Default is 'medium'. 345 352 */ 346 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 347 348 return $html; 353 return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 349 354 } 350 355 … … 446 451 * @param bool|array $crop Optional. Whether to crop image to specified height and width or resize. 447 452 * An array can specify positioning of the crop area. Default false. 448 * @return bool|array False on failure. Returned array matches parameters for `imagecopyresampled()`.453 * @return false|array False on failure. Returned array matches parameters for `imagecopyresampled()`. 449 454 */ 450 455 function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) { … … 552 557 * @param bool $crop Optional. Whether to crop image to specified height and width or resize. 553 558 * Default false. 554 * @return bool|array False, if no image was created. Metadata array on success.559 * @return false|array False, if no image was created. Metadata array on success. 555 560 */ 556 561 function image_make_intermediate_size( $file, $width, $height, $crop = false ) { … … 595 600 * @param array|string $size Optional. Registered image size to retrieve or flat array of height 596 601 * and width dimensions. Default 'thumbnail'. 597 * @return bool|array False on failure or array of file path, width, and height on success.602 * @return false|array False on failure or array of file path, width, and height on success. 598 603 */ 599 604 function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { … … 686 691 * array of height and width dimensions. Default 'thumbnail'. 687 692 * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. 688 * @return bool|array Returns an array (url, width, height), or false, if no image is available.693 * @return false|array Returns an array (url, width, height), or false, if no image is available. 689 694 */ 690 695 function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) { … … 726 731 */ 727 732 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') { 728 729 733 $html = ''; 730 734 $image = wp_get_attachment_image_src($attachment_id, $size, $icon); … … 926 930 * 927 931 * @since 2.5.0 932 * 933 * @staticvar int $instance 928 934 * 929 935 * @param array $attr { … … 1200 1206 * @since 3.9.0 1201 1207 * 1208 * @global int $content_width 1209 * @staticvar int $instance 1210 * 1202 1211 * @param array $attr { 1203 1212 * Array of default playlist attributes. … … 1520 1529 * @since 3.6.0 1521 1530 * 1531 * @staticvar int $instance 1532 * 1522 1533 * @param array $attr { 1523 1534 * Attributes of the audio shortcode. … … 1532 1543 * } 1533 1544 * @param string $content Shortcode content. 1534 * @return string HTML content to display audio.1545 * @return string|void HTML content to display audio. 1535 1546 */ 1536 1547 function wp_audio_shortcode( $attr, $content = '' ) { … … 1712 1723 * 1713 1724 * @since 3.6.0 1725 * 1726 * @global int $content_width 1727 * @staticvar int $instance 1714 1728 * 1715 1729 * @param array $attr { … … 1730 1744 * } 1731 1745 * @param string $content Shortcode content. 1732 * @return string HTML content to display video.1746 * @return string|void HTML content to display video. 1733 1747 */ 1734 1748 function wp_video_shortcode( $attr, $content = '' ) { … … 1950 1964 * 0 or 'none' will default to 'post_title' or `$text`. Default 'thumbnail'. 1951 1965 * @param string $text Optional. Link text. Default false. 1952 * @return string HTML output for the previous image link.1953 1966 */ 1954 1967 function previous_image_link( $size = 'thumbnail', $text = false ) { … … 1966 1979 * 0 or 'none' will default to 'post_title' or `$text`. Default 'thumbnail'. 1967 1980 * @param string $text Optional. Link text. Default false. 1968 * @return string HTML output for the next image link.1969 1981 */ 1970 1982 function next_image_link($size = 'thumbnail', $text = false) { … … 1983 1995 * Default 'thumbnail'. 1984 1996 * @param bool $text Optional. Link text. Default false. 1985 * @return string The adjacent image link.1986 1997 */ 1987 1998 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) { … … 2121 2132 * @since 2.9.0 2122 2133 * 2123 * @ see WP_Embed::register_handler()2134 * @global WP_Embed $wp_embed 2124 2135 * 2125 2136 * @param string $id An internal ID/name for the handler. Needs to be unique. … … 2139 2150 * @since 2.9.0 2140 2151 * 2141 * @ see WP_Embed::unregister_handler()2152 * @global WP_Embed $wp_embed 2142 2153 * 2143 2154 * @param string $id The handler ID that should be removed. … … 2160 2171 * 2161 2172 * @since 2.9.0 2173 * 2174 * @global int $content_width 2162 2175 * 2163 2176 * @param string $url Optional. The URL that should be embedded. Default empty. … … 2367 2380 * @since 4.0.0 2368 2381 * 2382 * @global WP_Embed $wp_embed 2383 * 2369 2384 * @param array $matches The RegEx matches from the provided regex when calling 2370 2385 * wp_embed_register_handler(). … … 2398 2413 * @since 3.6.0 2399 2414 * 2400 * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().2401 * @param array $attr Embed attributes.2415 * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler(). 2416 * @param array $attr Embed attributes. 2402 2417 * @param string $url The original URL that was matched by the regex. 2403 * @param array $rawattr The original unmodified attributes.2418 * @param array $rawattr The original unmodified attributes. 2404 2419 * @return string The embed HTML. 2405 2420 */ … … 2553 2568 * 2554 2569 * @param array $args Optional. Array of arguments for choosing a capable editor. Default empty array. 2555 * @return string| boolClass name for the first editor that claims to support the request. False if no2570 * @return string|false Class name for the first editor that claims to support the request. False if no 2556 2571 * editor claims to support the request. 2557 2572 */ … … 2599 2614 */ 2600 2615 function wp_plupload_default_settings() { 2601 global $wp_scripts;2616 $wp_scripts = wp_scripts(); 2602 2617 2603 2618 $data = $wp_scripts->get_data( 'wp-plupload', 'data' ); … … 2674 2689 * 2675 2690 * @param mixed $attachment Attachment ID or object. 2676 * @return array Array of attachment details.2691 * @return array|void Array of attachment details. 2677 2692 */ 2678 2693 function wp_prepare_attachment_for_js( $attachment ) { … … 2867 2882 * @since 3.5.0 2868 2883 * 2884 * @global int $content_width 2885 * @global wpdb $wpdb 2886 * @global WP_Locale $wp_locale 2887 * 2869 2888 * @param array $args { 2870 2889 * Arguments for enqueuing media scripts. … … 2872 2891 * @type int|WP_Post A post object or ID. 2873 2892 * } 2874 * @return array List of media view settings.2875 2893 */ 2876 2894 function wp_enqueue_media( $args = array() ) { 2877 2878 2895 // Enqueue me just once per page, please. 2879 2896 if ( did_action( 'wp_enqueue_media' ) ) … … 3428 3445 * @since 4.0.0 3429 3446 * 3430 * @global $wp_version3447 * @global string $wp_version 3431 3448 * 3432 3449 * @return array The relevant CSS file URLs.
Note: See TracChangeset
for help on using the changeset viewer.