Changeset 31530
- Timestamp:
- 02/24/2015 07:41:24 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r31309 r31530 60 60 } 61 61 elseif ( $size == 'large' ) { 62 // We're inserting a large size image into the editor. If it's a really 63 // big image we'll scale it down to fit reasonably within the editor 64 // itself, and within the theme's content width if it's known. The user 65 // can resize it in the editor if they wish. 62 /* 63 * We're inserting a large size image into the editor. If it's a really 64 * big image we'll scale it down to fit reasonably within the editor 65 * itself, and within the theme's content width if it's known. The user 66 * can resize it in the editor if they wish. 67 */ 66 68 $max_width = intval(get_option('large_size_w')); 67 69 $max_height = intval(get_option('large_size_h')); … … 110 112 * @since 2.5.0 111 113 * 112 * @param int|string $width Optional. Width attribute value.113 * @param int|string $height Optional. Height attribute value.114 * @param int|string $width Image width in pixels. 115 * @param int|string $height Image height in pixels. 114 116 * @return string HTML attributes for width and, or height. 115 117 */ 116 function image_hwstring( $width, $height) {118 function image_hwstring( $width, $height ) { 117 119 $out = ''; 118 120 if ($width) … … 141 143 * @since 2.5.0 142 144 * 143 * @param int $id Attachment ID for image. 144 * @param array|string $size Optional, default is 'medium'. Size of image, either array or string. 145 * @param int $id Attachment ID for image. 146 * @param array|string $size Optional. Image size to scale to. Accepts a registered image size 147 * or flat array of height and width values. Default 'medium'. 145 148 * @return bool|array False on failure, array on success. 146 149 */ 147 function image_downsize( $id, $size = 'medium') {150 function image_downsize( $id, $size = 'medium' ) { 148 151 149 152 if ( !wp_attachment_is_image($id) ) … … 285 288 286 289 /** 287 * An <img src />tag for an image attachment, scaling it down if requested.290 * Gets an img tag for an image attachment, scaling it down if requested. 288 291 * 289 292 * The filter 'get_image_tag_class' allows for changing the class name for the … … 298 301 * @since 2.5.0 299 302 * 300 * @param int $id Attachment ID. 301 * @param string $alt Image Description for the alt attribute. 302 * @param string $title Image Description for the title attribute. 303 * @param string $align Part of the class name for aligning the image. 304 * @param string $size Optional. Default is 'medium'. 303 * @param int $id Attachment ID. 304 * @param string $alt Image Description for the alt attribute. 305 * @param string $title Image Description for the title attribute. 306 * @param string $align Part of the class name for aligning the image. 307 * @param string|array $size Optional. Registered image size to retrieve a tag for, or flat array 308 * of height and width values. Default 'medium'. 305 309 * @return string HTML IMG element for given image attachment 306 310 */ 307 function get_image_tag( $id, $alt, $title, $align, $size='medium') {311 function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) { 308 312 309 313 list( $img_src, $width, $height ) = image_downsize($id, $size); … … 346 350 347 351 /** 348 * Calculates the new dimensions for a down sampled image.352 * Calculates the new dimensions for a down-sampled image. 349 353 * 350 354 * If either width or height are empty, no constraint is applied on … … 353 357 * @since 2.5.0 354 358 * 355 * @param int $current_width Current width of the image.359 * @param int $current_width Current width of the image. 356 360 * @param int $current_height Current height of the image. 357 * @param int $max_width Optional. Maximum wanted width.358 * @param int $max_height Optional. Maximum wanted height.361 * @param int $max_width Optional. Max width in pixels to constrain to. Default 0. 362 * @param int $max_height Optional. Max height in pixels to constrain to. Default 0. 359 363 * @return array First item is the width, the second item is the height. 360 364 */ 361 function wp_constrain_dimensions( $current_width, $current_height, $max_width =0, $max_height=0 ) {365 function wp_constrain_dimensions( $current_width, $current_height, $max_width = 0, $max_height = 0 ) { 362 366 if ( !$max_width && !$max_height ) 363 367 return array( $current_width, $current_height ); … … 406 410 } 407 411 412 /** 413 * Filter dimensions to constrain down-sampled images to. 414 * 415 * @since 4.1.0 416 * 417 * @param array $dimensions The image width and height. 418 * @param int $current_width The current width of the image. 419 * @param int $current_height The current height of the image. 420 * @param int $max_width The maximum width permitted. 421 * @param int $max_height The maximum height permitted. 422 */ 408 423 return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height ); 409 424 } 410 425 411 426 /** 412 * Retrieve calculated resize dimensions for use in WP_Image_Editor.427 * Retrieves calculated resize dimensions for use in WP_Image_Editor. 413 428 * 414 429 * Calculates dimensions and coordinates for a resized image that fits … … 524 539 525 540 /** 526 * Resize an image to make a thumbnail or intermediate size.541 * Resizes an image to make a thumbnail or intermediate size. 527 542 * 528 543 * The returned array has the file size, the image width, and image height. The … … 532 547 * @since 2.5.0 533 548 * 534 * @param string $file File path. 535 * @param int $width Image width. 536 * @param int $height Image height. 537 * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize. 549 * @param string $file File path. 550 * @param int $width Image width. 551 * @param int $height Image height. 552 * @param bool $crop Optional. Whether to crop image to specified height and width or resize. 553 * Default false. 538 554 * @return bool|array False, if no image was created. Metadata array on success. 539 555 */ … … 556 572 557 573 /** 558 * Retrieve the image's intermediate size (resized) path, width, and height.574 * Retrieves the image's intermediate size (resized) path, width, and height. 559 575 * 560 576 * The $size parameter can be an array with the width and height respectively. … … 575 591 * 576 592 * @since 2.5.0 577 * @see add_image_size()578 * 579 * @param int $post_id Attachment ID for image.580 * @param array|string $size Optional, default is 'thumbnail'. Size of image, either array or string.593 * 594 * @param int $post_id Attachment ID. 595 * @param array|string $size Optional. Registered image size to retrieve or flat array of height 596 * and width dimensions. Default 'thumbnail'. 581 597 * @return bool|array False on failure or array of file path, width, and height on success. 582 598 */ 583 function image_get_intermediate_size( $post_id, $size='thumbnail') {599 function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) { 584 600 if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) ) 585 601 return false; … … 634 650 635 651 /** 636 * Get the available image sizes 652 * Gets the available intermediate image sizes. 653 * 637 654 * @since 3.0.0 638 * @return array Returns a filtered array of image size strings 655 * 656 * @global array $_wp_additional_image_sizes 657 * 658 * @return array Returns a filtered array of image size strings. 639 659 */ 640 660 function get_intermediate_image_sizes() { … … 662 682 * @since 2.5.0 663 683 * 664 * @param int $attachment_id Image attachment ID. 665 * @param string $size Optional, default is 'thumbnail'. 666 * @param bool $icon Optional, default is false. Whether it is an icon. 684 * @param int $attachment_id Image attachment ID. 685 * @param string|array $size Optional. Registered image size to retrieve the source for or a flat 686 * array of height and width dimensions. Default 'thumbnail'. 687 * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. 667 688 * @return bool|array Returns an array (url, width, height), or false, if no image is available. 668 689 */ 669 function wp_get_attachment_image_src( $attachment_id, $size='thumbnail', $icon = false) {690 function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) { 670 691 671 692 // get a thumbnail or intermediate image if there is one … … 678 699 /** This filter is documented in wp-includes/post.php */ 679 700 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 701 680 702 $src_file = $icon_dir . '/' . wp_basename($src); 681 703 @list($width, $height) = getimagesize($src_file); … … 689 711 * Get an HTML img element representing an image attachment 690 712 * 691 * While $sizewill accept an array, it is better to register a size with713 * While `$size` will accept an array, it is better to register a size with 692 714 * add_image_size() so that a cropped version is generated. It's much more 693 715 * efficient than having to find the closest-sized image and then having the … … 696 718 * @since 2.5.0 697 719 * 698 * @see add_image_size()699 *700 720 * @param int $attachment_id Image attachment ID. 701 * @param string|array $size Optional. Default 'thumbnail'. 702 * @param bool $icon Optional. Whether it is an icon. Default false. 703 * @param string|array $attr Optional. Attributes for the image markup. Default empty string. 721 * @param string|array $size Optional. Registered image size or flat array of height and width 722 * dimensions. Default 'thumbnail'. 723 * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. 724 * @param string|array $attr Optional. Attributes for the image markup. Default empty. 704 725 * @return string HTML img element or empty string on failure. 705 726 */ … … 750 771 751 772 /** 752 * Adds a 'wp-post-image' class to post thumbnails 753 * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to 754 * dynamically add/remove itself so as to only filter post thumbnails 755 * 773 * Adds a 'wp-post-image' class to post thumbnails. Internal use only. 774 * 775 * Uses the 'begin_fetch_post_thumbnail_html' and 'end_fetch_post_thumbnail_html' action hooks to 776 * dynamically add/remove itself so as to only filter post thumbnails. 777 * 778 * @ignore 756 779 * @since 2.9.0 757 * @param array $attr Attributes including src, class, alt, title 758 * @return array 780 * 781 * @param array $attr Thumbnail attributes including src, class, alt, title. 782 * @return array Modified array of attributes including the new 'wp-post-image' class. 759 783 */ 760 784 function _wp_post_thumbnail_class_filter( $attr ) { … … 764 788 765 789 /** 766 * Adds _wp_post_thumbnail_class_filter to the wp_get_attachment_image_attributes filter 767 * 790 * Adds '_wp_post_thumbnail_class_filter' callback to the 'wp_get_attachment_image_attributes' 791 * filter hook. Internal use only. 792 * 793 * @ignore 768 794 * @since 2.9.0 795 * 796 * @param array $attr Thumbnail attributes including src, class, alt, title. 769 797 */ 770 798 function _wp_post_thumbnail_class_filter_add( $attr ) { … … 773 801 774 802 /** 775 * Removes _wp_post_thumbnail_class_filter from the wp_get_attachment_image_attributes filter 776 * 803 * Removes the '_wp_post_thumbnail_class_filter' callback from the 'wp_get_attachment_image_attributes' 804 * filter hook. Internal use only. 805 * 806 * @ignore 777 807 * @since 2.9.0 808 * 809 * @param array $attr Thumbnail attributes including src, class, alt, title. 778 810 */ 779 811 function _wp_post_thumbnail_class_filter_remove( $attr ) { … … 785 817 786 818 /** 787 * The Caption shortcode.819 * Builds the Caption shortcode output. 788 820 * 789 821 * Allows a plugin to replace the content that would otherwise be returned. The … … 796 828 * @since 2.6.0 797 829 * 798 * @param array $attr {830 * @param array $attr { 799 831 * Attributes of the caption shortcode. 800 832 * … … 806 838 * @type string $class Additional class name(s) added to the caption container. 807 839 * } 808 * @param string $content Optional.Shortcode content.840 * @param string $content Shortcode content. 809 841 * @return string HTML content to display the caption. 810 842 */ … … 888 920 889 921 /** 890 * The Gallery shortcode.922 * Builds the Gallery shortcode output. 891 923 * 892 924 * This implements the functionality of the Gallery Shortcode for displaying … … 1106 1138 1107 1139 /** 1108 * Output the templates used by playlists.1140 * Outputs the templates used by playlists. 1109 1141 * 1110 1142 * @since 3.9.0 … … 1144 1176 1145 1177 /** 1146 * Output and enqueue default scripts and styles for playlists.1178 * Outputs and enqueue default scripts and styles for playlists. 1147 1179 * 1148 1180 * @since 3.9.0 … … 1161 1193 1162 1194 /** 1163 * The playlist shortcode.1195 * Builds the Playlist shortcode output. 1164 1196 * 1165 1197 * This implements the functionality of the playlist shortcode for displaying … … 1407 1439 1408 1440 /** 1409 * Provide a No-JS Flash fallback as a last resort for audio / video1441 * Provides a No-JS Flash fallback as a last resort for audio / video. 1410 1442 * 1411 1443 * @since 3.6.0 1412 1444 * 1413 * @param string $url 1414 * @return string Fallback HTML 1445 * @param string $url The media element URL. 1446 * @return string Fallback HTML. 1415 1447 */ 1416 1448 function wp_mediaelement_fallback( $url ) { … … 1427 1459 1428 1460 /** 1429 * Return a filtered list of WP-supported audio formats.1461 * Returns a filtered list of WP-supported audio formats. 1430 1462 * 1431 1463 * @since 3.6.0 1432 * @return array 1464 * 1465 * @return array Supported audio formats. 1433 1466 */ 1434 1467 function wp_get_audio_extensions() { … … 1445 1478 1446 1479 /** 1447 * Return useful keys to use to lookup data from an attachment's stored metadata.1480 * Returns useful keys to use to lookup data from an attachment's stored metadata. 1448 1481 * 1449 1482 * @since 3.9.0 1450 1483 * 1451 1484 * @param WP_Post $attachment The current attachment, provided for context. 1452 * @param string $context The context. Accepts 'edit', 'display'. Default 'display'.1485 * @param string $context Optional. The context. Accepts 'edit', 'display'. Default 'display'. 1453 1486 * @return array Key/value pairs of field keys to labels. 1454 1487 */ … … 1480 1513 } 1481 1514 /** 1482 * The Audio shortcode.1515 * Builds the Audio shortcode output. 1483 1516 * 1484 1517 * This implements the functionality of the Audio Shortcode for displaying … … 1487 1520 * @since 3.6.0 1488 1521 * 1489 * @param array $attr {1522 * @param array $attr { 1490 1523 * Attributes of the audio shortcode. 1491 1524 * … … 1498 1531 * @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'. 1499 1532 * } 1500 * @param string $content Optional.Shortcode content.1533 * @param string $content Shortcode content. 1501 1534 * @return string HTML content to display audio. 1502 1535 */ … … 1654 1687 1655 1688 /** 1656 * Return a filtered list of WP-supported video formats1689 * Returns a filtered list of WP-supported video formats. 1657 1690 * 1658 1691 * @since 3.6.0 1659 * @return array 1692 * 1693 * @return array List of supported video formats. 1660 1694 */ 1661 1695 function wp_get_video_extensions() { … … 1672 1706 1673 1707 /** 1674 * The Video shortcode.1708 * Builds the Video shortcode output. 1675 1709 * 1676 1710 * This implements the functionality of the Video Shortcode for displaying … … 1679 1713 * @since 3.6.0 1680 1714 * 1681 * @param array $attr {1715 * @param array $attr { 1682 1716 * Attributes of the shortcode. 1683 1717 * … … 1695 1729 * Default 'video-{$post_id}-{$instance}'. 1696 1730 * } 1697 * @param string $content Optional.Shortcode content.1731 * @param string $content Shortcode content. 1698 1732 * @return string HTML content to display video. 1699 1733 */ … … 1907 1941 1908 1942 /** 1909 * Display previous image link that has the same post parent.1943 * Displays previous image link that has the same post parent. 1910 1944 * 1911 1945 * @since 2.5.0 1912 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text; 1913 * @param string $text Optional, default is false. If included, link will reflect $text variable. 1914 * @return string HTML content. 1915 */ 1916 function previous_image_link($size = 'thumbnail', $text = false) { 1946 * 1947 * @see adjacent_image_link() 1948 * 1949 * @param string|array $size Optional. Registered image size or flat array of height and width dimensions. 1950 * 0 or 'none' will default to 'post_title' or `$text`. Default 'thumbnail'. 1951 * @param string $text Optional. Link text. Default false. 1952 * @return string HTML output for the previous image link. 1953 */ 1954 function previous_image_link( $size = 'thumbnail', $text = false ) { 1917 1955 adjacent_image_link(true, $size, $text); 1918 1956 } 1919 1957 1920 1958 /** 1921 * Display next image link that has the same post parent.1959 * Displays next image link that has the same post parent. 1922 1960 * 1923 1961 * @since 2.5.0 1924 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text; 1925 * @param string $text Optional, default is false. If included, link will reflect $text variable. 1926 * @return string HTML content. 1962 * 1963 * @see adjacent_image_link() 1964 * 1965 * @param string|array $size Optional. Registered image size or flat array of height and width dimensions. 1966 * 0 or 'none' will default to 'post_title' or `$text`. Default 'thumbnail'. 1967 * @param string $text Optional. Link text. Default false. 1968 * @return string HTML output for the next image link. 1927 1969 */ 1928 1970 function next_image_link($size = 'thumbnail', $text = false) { … … 1931 1973 1932 1974 /** 1933 * Display next or previous image link that has the same post parent.1975 * Displays next or previous image link that has the same post parent. 1934 1976 * 1935 1977 * Retrieves the current attachment object from the $post global. … … 1937 1979 * @since 2.5.0 1938 1980 * 1939 * @param bool $prev Optional. Default is true to display previous link, false for next. 1940 */ 1941 function adjacent_image_link($prev = true, $size = 'thumbnail', $text = false) { 1981 * @param bool $prev Optional. Whether to display the next (false) or previous (true) link. Default true. 1982 * @param string|array $size Optional. Registered image size or flat array of height and width dimensions. 1983 * Default 'thumbnail'. 1984 * @param bool $text Optional. Link text. Default false. 1985 * @return string The adjacent image link. 1986 */ 1987 function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) { 1942 1988 $post = get_post(); 1943 1989 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); … … 1980 2026 1981 2027 /** 1982 * Retrieve taxonomies attached tothe attachment.2028 * Retrieves taxonomies attached to given the attachment. 1983 2029 * 1984 2030 * @since 2.5.0 1985 2031 * 1986 * @param int|array|object $attachment Attachment ID, Attachment data array, or Attachmentdata object.2032 * @param int|array|object $attachment Attachment ID, data array, or data object. 1987 2033 * @return array Empty array on failure. List of taxonomies on success. 1988 2034 */ 1989 function get_attachment_taxonomies( $attachment) {2035 function get_attachment_taxonomies( $attachment ) { 1990 2036 if ( is_int( $attachment ) ) { 1991 2037 $attachment = get_post( $attachment ); … … 2019 2065 2020 2066 /** 2021 * Ret urnall of the taxonomy names that are registered for attachments.2067 * Retrieves all of the taxonomy names that are registered for attachments. 2022 2068 * 2023 2069 * Handles mime-type-specific taxonomies such as attachment:image and attachment:video. 2024 2070 * 2025 2071 * @since 3.5.0 2026 * @see get_attachment_taxonomies() 2027 * 2028 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 2072 * 2073 * @see get_taxonomies() 2074 * 2075 * @param string $output Optional. The type of taxonomy output to return. Accepts 'names' or 'objects'. 2076 * Default 'names'. 2029 2077 * @return array The names of all taxonomy of $object_type. 2030 2078 */ … … 2048 2096 /** 2049 2097 * Create new GD image resource with transparency support 2050 * @TODO: Deprecate if possible. 2098 * 2099 * @todo: Deprecate if possible. 2051 2100 * 2052 2101 * @since 2.9.0 2053 2102 * 2054 * @param int $width Image width2055 * @param int $height Image height 2056 * @return resource resource2103 * @param int $width Image width in pixels. 2104 * @param int $height Image height in pixels.. 2105 * @return resource The GD image resource. 2057 2106 */ 2058 2107 function wp_imagecreatetruecolor($width, $height) { … … 2066 2115 2067 2116 /** 2068 * Register an embed handler. This function should probably only be used for sites that do not support oEmbed. 2117 * Registers an embed handler. 2118 * 2119 * Should probably only be used for sites that do not support oEmbed. 2069 2120 * 2070 2121 * @since 2.9.0 2122 * 2071 2123 * @see WP_Embed::register_handler() 2072 2124 * 2073 * @ global WP_Embed $wp_embed2074 * @param string $ id2075 * @param string $regex2076 * @param callable $callback2077 * @param int $priority2125 * @param string $id An internal ID/name for the handler. Needs to be unique. 2126 * @param string $regex The regex that will be used to see if this handler should be used for a URL. 2127 * @param callback $callback The callback function that will be called if the regex is matched. 2128 * @param int $priority Optional. Used to specify the order in which the registered handlers will 2129 * be tested. Default 10. 2078 2130 */ 2079 2131 function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) { … … 2083 2135 2084 2136 /** 2085 * Unregister a previouslyregistered embed handler.2137 * Unregisters a previously-registered embed handler. 2086 2138 * 2087 2139 * @since 2.9.0 2140 * 2088 2141 * @see WP_Embed::unregister_handler() 2089 2142 * 2090 * @global WP_Embed $wp_embed 2091 * @param string $id 2092 * @param int $priority 2143 * @param string $id The handler ID that should be removed. 2144 * @param int $priority Optional. The priority of the handler to be removed. Default 10. 2093 2145 */ 2094 2146 function wp_embed_unregister_handler( $id, $priority = 10 ) { … … 2139 2191 * @since 2.9.0 2140 2192 * 2141 * @param int $example_width The width of an example embed. 2193 * @see wp_constrain_dimensions() 2194 * 2195 * @param int $example_width The width of an example embed. 2142 2196 * @param int $example_height The height of an example embed. 2143 * @param int $max_width The maximum allowed width.2144 * @param int $max_height The maximum allowed height.2197 * @param int $max_width The maximum allowed width. 2198 * @param int $max_height The maximum allowed height. 2145 2199 * @return array The maximum possible width and height based on the example ratio. 2146 2200 */ … … 2158 2212 * 2159 2213 * @since 2.9.0 2214 * 2160 2215 * @see WP_oEmbed 2161 2216 * 2162 * @param string $url The URL that should be embedded. 2163 * @param array $args Additional arguments and parameters. 2217 * @param string $url The URL that should be embedded. 2218 * @param array $args Optional. Additional arguments and parameters for retrieving embed HTML. 2219 * Default empty. 2164 2220 * @return false|string False on failure or the embed HTML on success. 2165 2221 */ … … 2174 2230 * 2175 2231 * @since 2.9.0 2232 * 2176 2233 * @see WP_oEmbed 2177 2234 * 2178 * @param string $format The format of URL that this provider can handle. You can use asterisks as wildcards. 2179 * @param string $provider The URL to the oEmbed provider. 2180 * @param boolean $regex Whether the $format parameter is in a regex format. 2235 * @param string $format The format of URL that this provider can handle. You can use asterisks 2236 * as wildcards. 2237 * @param string $provider The URL to the oEmbed provider. 2238 * @param boolean $regex Optional. Whether the `$format` parameter is in a RegEx format. Default false. 2181 2239 */ 2182 2240 function wp_oembed_add_provider( $format, $provider, $regex = false ) { … … 2195 2253 * 2196 2254 * @since 3.5.0 2255 * 2197 2256 * @see WP_oEmbed 2198 2257 * 2199 2258 * @param string $format The URL format for the oEmbed provider to remove. 2259 * @return bool Was the provider removed successfully? 2200 2260 */ 2201 2261 function wp_oembed_remove_provider( $format ) { … … 2223 2283 * 2224 2284 * @since 2.9.0 2285 * 2286 * @see wp_embed_register_handler() 2225 2287 */ 2226 2288 function wp_maybe_load_embeds() { … … 2262 2324 2263 2325 /** 2264 * The Google Video embed handler callback. Google Video does not support oEmbed. 2326 * The Google Video embed handler callback. 2327 * 2328 * Google Video does not support oEmbed. 2265 2329 * 2266 2330 * @see WP_Embed::register_handler() 2267 2331 * @see WP_Embed::shortcode() 2268 2332 * 2269 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.2270 * @param array $attrEmbed attributes.2271 * @param string $url The original URL that was matched by the regex.2272 * @param array $rawattr The original unmodified attributes.2333 * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler(). 2334 * @param array $attr Embed attributes. 2335 * @param string $url The original URL that was matched by the regex. 2336 * @param array $rawattr The original unmodified attributes. 2273 2337 * @return string The embed HTML. 2274 2338 */ … … 2288 2352 * 2289 2353 * @param string $html Google Video HTML embed markup. 2290 * @param array $matches The regex matches from the provided regex.2354 * @param array $matches The RegEx matches from the provided regex. 2291 2355 * @param array $attr An array of embed attributes. 2292 2356 * @param string $url The original URL that was matched by the regex. … … 2303 2367 * @since 4.0.0 2304 2368 * 2305 * @param array $matches The regex matches from the provided regex when calling2306 * {@see wp_embed_register_handler()}.2369 * @param array $matches The RegEx matches from the provided regex when calling 2370 * wp_embed_register_handler(). 2307 2371 * @param array $attr Embed attributes. 2308 2372 * @param string $url The original URL that was matched by the regex. … … 2313 2377 global $wp_embed; 2314 2378 $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" ); 2379 2315 2380 /** 2316 2381 * Filter the YoutTube embed output. … … 2333 2398 * @since 3.6.0 2334 2399 * 2335 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.2400 * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler(). 2336 2401 * @param array $attr Embed attributes. 2337 2402 * @param string $url The original URL that was matched by the regex. … … 2360 2425 * @since 3.6.0 2361 2426 * 2362 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.2363 * @param array $attrEmbed attributes.2364 * @param string $url The original URL that was matched by the regex.2365 * @param array $rawattr The original unmodified attributes.2427 * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler(). 2428 * @param array $attr Embed attributes. 2429 * @param string $url The original URL that was matched by the regex. 2430 * @param array $rawattr The original unmodified attributes. 2366 2431 * @return string The embed HTML. 2367 2432 */ … … 2408 2473 2409 2474 /** 2410 * Determine the maximum upload size allowed in php.ini.2475 * Determines the maximum upload size allowed in php.ini. 2411 2476 * 2412 2477 * @since 2.5.0 … … 2434 2499 * 2435 2500 * @since 3.5.0 2436 * @access public 2437 * 2438 * @param string $path Path to file to load 2439 * @param array $args Additional data. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} } 2440 * @return WP_Image_Editor|WP_Error 2501 * 2502 * @param string $path Path to the file to load. 2503 * @param array $args Optional. Additional arguments for retrieving the image editor. 2504 * Default empty array. 2505 * @return WP_Image_Editor|WP_Error The WP_Image_Editor object if successful, an WP_Error 2506 * object otherwise. 2441 2507 */ 2442 2508 function wp_get_image_editor( $path, $args = array() ) { … … 2471 2537 * 2472 2538 * @since 3.5.0 2473 * @access public2474 * 2475 * @param string|array $args Array of requirements. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }2476 * @return bool ean true if an eligible editor is found; false otherwise2539 * 2540 * @param string|array $args Optional. Array of arguments to retrieve the image editor supports. 2541 * Default empty array. 2542 * @return bool True if an eligible editor is found; false otherwise. 2477 2543 */ 2478 2544 function wp_image_editor_supports( $args = array() ) { … … 2483 2549 * Tests which editors are capable of supporting the request. 2484 2550 * 2551 * @ignore 2485 2552 * @since 3.5.0 2486 * @access private2487 * 2488 * @ param array $args Additional data. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }2489 * @return string|bool Class name for the first editor that claims to support the request. False if noeditor claims to support the request.2553 * 2554 * @param array $args Optional. Array of arguments for choosing a capable editor. Default empty array. 2555 * @return string|bool Class name for the first editor that claims to support the request. False if no 2556 * editor claims to support the request. 2490 2557 */ 2491 2558 function _wp_image_editor_choose( $args = array() ) { … … 2799 2866 * 2800 2867 * @since 3.5.0 2868 * 2869 * @param array $args { 2870 * Arguments for enqueuing media scripts. 2871 * 2872 * @type int|WP_Post A post object or ID. 2873 * } 2874 * @return array List of media view settings. 2801 2875 */ 2802 2876 function wp_enqueue_media( $args = array() ) { … … 3090 3164 3091 3165 /** 3092 * Retrieve media attached to the passed post.3166 * Retrieves media attached to the passed post. 3093 3167 * 3094 3168 * @since 3.6.0 … … 3142 3216 * 3143 3217 * @param string $content A string which might contain media data. 3144 * @param array $types array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'3145 * @return array A list of found HTML media embeds 3218 * @param array $types An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'. 3219 * @return array A list of found HTML media embeds. 3146 3220 */ 3147 3221 function get_media_embedded_in_content( $content, $types = null ) { … … 3164 3238 3165 3239 /** 3166 * Retrieve galleries from the passed post's content.3240 * Retrieves galleries from the passed post's content. 3167 3241 * 3168 3242 * @since 3.6.0 3169 3243 * 3170 * @param int|WP_Post $post Optional.Post ID or object.3171 * @param bool $html Whether to return HTML or data in the array.3244 * @param int|WP_Post $post Post ID or object. 3245 * @param bool $html Optional. Whether to return HTML or data in the array. Default true. 3172 3246 * @return array A list of arrays, each containing gallery data and srcs parsed 3173 * 3247 * from the expanded shortcode. 3174 3248 */ 3175 3249 function get_post_galleries( $post, $html = true ) { … … 3221 3295 * 3222 3296 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. 3223 * @param bool $html Whether to return HTML or data.3297 * @param bool $html Optional. Whether to return HTML or data. Default is true. 3224 3298 * @return string|array Gallery data and srcs parsed from the expanded shortcode. 3225 3299 */ … … 3245 3319 * @since 3.6.0 3246 3320 * 3247 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. 3321 * @see get_post_galleries() 3322 * 3323 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. 3248 3324 * @return array A list of lists, each containing image srcs parsed. 3249 * 3325 * from an expanded shortcode 3250 3326 */ 3251 3327 function get_post_galleries_images( $post = 0 ) { … … 3255 3331 3256 3332 /** 3257 * Check a post's content for galleries and return the image srcs for the first found gallery3333 * Checks a post's content for galleries and return the image srcs for the first found gallery 3258 3334 * 3259 3335 * @since 3.6.0 3260 3336 * 3261 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. 3337 * @see get_post_gallery() 3338 * 3339 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. 3262 3340 * @return array A list of a gallery's image srcs in order. 3263 3341 */ … … 3268 3346 3269 3347 /** 3270 * Maybe attempt to generate attachment metadata, if missing.3348 * Maybe attempts to generate attachment metadata, if missing. 3271 3349 * 3272 3350 * @since 3.9.0 … … 3293 3371 3294 3372 /** 3295 * Tr yto convert an attachment URL into a post ID.3373 * Tries to convert an attachment URL into a post ID. 3296 3374 * 3297 3375 * @since 4.0.0 … … 3322 3400 3323 3401 /** 3324 * Return the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view.3402 * Returns the URLs for CSS files used in an iframe-sandbox'd TinyMCE media view. 3325 3403 * 3326 3404 * @since 4.0.0
Note: See TracChangeset
for help on using the changeset viewer.