Changeset 28128
- Timestamp:
- 04/15/2014 01:35:49 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r28108 r28128 79 79 } 80 80 81 /** 82 * Filter the maximum image size dimensions for the editor. 83 * 84 * @since 2.5.0 85 * 86 * @param array $max_image_size An array with the width as the first element, 87 * and the height as the second element. 88 * @param string|array $size Size of what the result image should be. 89 * @param string $context The context the image is being resized for. 90 * Possible values are 'display' (like in a theme) 91 * or 'edit' (like inserting into an editor). 92 */ 81 93 list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context ); 82 94 … … 127 139 * 128 140 * @since 2.5.0 129 * @uses apply_filters() Calls 'image_downsize' on $id and $size to provide130 * resize services.131 141 * 132 142 * @param int $id Attachment ID for image. … … 139 149 return false; 140 150 141 // plugins can use this to provide resize services 142 if ( $out = apply_filters( 'image_downsize', false, $id, $size ) ) 151 /** 152 * Filter whether to preempt the output of image_downsize(). 153 * 154 * Passing a truthy value to the filter will effectively short-circuit 155 * down-sizing the image, returning that value as output instead. 156 * 157 * @since 2.5.0 158 * 159 * @param bool $downsize Whether to short-circuit the image downsize. Default false. 160 * @param int $id Attachment ID for image. 161 * @param array|string $size Size of image, either array or string. Default 'medium'. 162 */ 163 if ( $out = apply_filters( 'image_downsize', false, $id, $size ) ) { 143 164 return $out; 165 } 144 166 145 167 $img_url = wp_get_attachment_url($id); … … 274 296 * @since 2.5.0 275 297 * 276 * @uses apply_filters() The 'get_image_tag_class' filter is the IMG element277 * class attribute.278 * @uses apply_filters() The 'get_image_tag' filter is the full IMG element with279 * all attributes.280 *281 298 * @param int $id Attachment ID. 282 299 * @param string $alt Image Description for the alt attribute. … … 294 311 295 312 $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id; 296 $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); 313 314 /** 315 * Filter the value of the attachment's image tag class attribute. 316 * 317 * @since 2.6.0 318 * 319 * @param string $class CSS class name or space-separated list of classes. 320 * @param int $id Attachment ID. 321 * @param string $align Part of the class name for aligning the image. 322 * @param string $size Optional. Default is 'medium'. 323 */ 324 $class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size ); 297 325 298 326 $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />'; 299 327 328 /** 329 * Filter the HTML content for the image tag. 330 * 331 * @since 2.6.0 332 * 333 * @param string $html HTML content for the image. 334 * @param int $id Attachment ID. 335 * @param string $alt Alternate text. 336 * @param string $title Attachment title. 337 * @param string $align Part of the class name for aligning the image. 338 * @param string $size Optional. Default is 'medium'. 339 */ 300 340 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 301 341 … … 375 415 * 376 416 * @since 2.5.0 377 * @uses apply_filters() Calls 'image_resize_dimensions' on $orig_w, $orig_h, $dest_w,378 * $dest_h and $crop to provide custom resize dimensions.379 417 * 380 418 * @param int $orig_w Original width in pixels. … … 394 432 return false; 395 433 396 // plugins can use this to provide custom resize dimensions 434 /** 435 * Filter whether to preempt calculating the image resize dimensions. 436 * 437 * Passing a non-null value to the filter will effectively short-circuit 438 * image_resize_dimensions(), returning that value instead. 439 * 440 * @since 3.4.0 441 * 442 * @param null|mixed $null Whether to preempt output of the resize dimensions. 443 * @param int $orig_w Original width in pixels. 444 * @param int $orig_h Original height in pixels. 445 * @param int $dest_w New width in pixels. 446 * @param int $dest_h New height in pixels. 447 * @param bool|array $crop Whether to crop image to specified height and width or resize. 448 * An array can specify positioning of the crop area. Default false. 449 */ 397 450 $output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop ); 398 451 if ( null !== $output ) … … 579 632 $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) ); 580 633 634 /** 635 * Filter the list of intermediate image sizes. 636 * 637 * @since 2.5.0 638 * 639 * @param array $image_sizes An array of intermediate image sizes. Defaults 640 * are 'thumbnail', 'medium', 'large'. 641 */ 581 642 return apply_filters( 'intermediate_image_sizes', $image_sizes ); 582 643 } … … 603 664 604 665 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 666 /** This filter is documented in wp-includes/post.php */ 605 667 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 606 668 $src_file = $icon_dir . '/' . wp_basename($src); … … 620 682 * browser scale down the image. 621 683 * 684 * @since 2.5.0 685 * 622 686 * @see add_image_size() 623 * @uses apply_filters() Calls 'wp_get_attachment_image_attributes' hook on attributes array624 687 * @uses wp_get_attachment_image_src() Gets attachment file URL and dimensions 625 * @since 2.5.0626 688 * 627 689 * @param int $attachment_id Image attachment ID. … … 652 714 653 715 $attr = wp_parse_args($attr, $default_attr); 716 717 /** 718 * Filter the list of attachment image attributes. 719 * 720 * @since 2.8.0 721 * 722 * @param mixed $attr Attributes for the image markup. 723 * @param int $attachment_id Image attachment ID. 724 */ 654 725 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment ); 655 726 $attr = array_map( 'esc_attr', $attr ); … … 964 1035 $size_class = sanitize_html_class( $size ); 965 1036 $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; 1037 1038 /** 1039 * Filter the default gallery shortcode CSS styles. 1040 * 1041 * @since 2.5.0 1042 * 1043 * @param string $gallery_style Default gallery shortcode CSS styles. 1044 * @param string $gallery_div Opening HTML div container for the gallery shortcode output. 1045 */ 966 1046 $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div ); 967 1047 … … 1099 1179 * 1100 1180 * @param string $output Playlist output. Default empty. 1101 * @param array $attr Array of shortcode attributes. 1102 * @param string $type Type of playlist to generate output for. 1181 * @param array $attr An array of shortcode attributes. 1103 1182 */ 1104 1183 $output = apply_filters( 'post_playlist', '', $attr ); … … 1257 1336 if ( 1 === $instance ) { 1258 1337 /** 1259 * Hook to print and enqueue playlist scripts, styles, and JavaScript templates.1338 * Print and enqueue playlist scripts, styles, and JavaScript templates. 1260 1339 * 1261 1340 * @since 3.9.0 … … 1300 1379 */ 1301 1380 function wp_mediaelement_fallback( $url ) { 1381 /** 1382 * Filter the Mediaelement fallback output for no-JS. 1383 * 1384 * @since 3.6.0 1385 * 1386 * @param string $output Fallback output for no-JS. 1387 * @param string $url Media file URL. 1388 */ 1302 1389 return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url ); 1303 1390 } 1304 1391 1305 1392 /** 1306 * Return a filtered list of WP-supported audio formats 1393 * Return a filtered list of WP-supported audio formats. 1307 1394 * 1308 1395 * @since 3.6.0 … … 1310 1397 */ 1311 1398 function wp_get_audio_extensions() { 1399 /** 1400 * Filter the list of supported audio formats. 1401 * 1402 * @since 3.6.0 1403 * 1404 * @param array $extensions An array of support audio formats. Defaults are 1405 * 'mp3', 'ogg', 'wma', 'm4a', 'wav'. 1406 */ 1312 1407 return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'wma', 'm4a', 'wav' ) ); 1313 1408 } … … 1335 1430 1336 1431 /** 1337 * Filter the editable list of keys to look up data from an attachment's metadata.1432 * Filter the editable list of keys to look up data from an attachment's metadata. 1338 1433 * 1339 1434 * @since 3.9.0 … … 1341 1436 * @param array $fields Key/value pairs of field keys to labels. 1342 1437 * @param WP_Post $attachment Attachment object. 1438 * @param string $context The context. Accepts 'edit', 'display'. Default 'display'. 1343 1439 */ 1344 1440 return apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context ); … … 1384 1480 * @param int $instances Unique numeric ID of this audio shortcode instance. 1385 1481 */ 1386 $html = ''; 1387 $html = apply_filters( 'wp_audio_shortcode_override', $html, $attr, $content, $instances ); 1482 $html = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances ); 1388 1483 if ( '' !== $html ) 1389 1484 return $html; … … 1434 1529 } 1435 1530 1531 /** 1532 * Filter the media library used for the audio shortcode. 1533 * 1534 * @since 3.6.0 1535 * 1536 * @param string $library Media library used for the audio shortcode. 1537 */ 1436 1538 $library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' ); 1437 1539 if ( 'mediaelement' === $library && did_action( 'init' ) ) { … … 1440 1542 } 1441 1543 1544 /** 1545 * Filter the class attribute for the audio shortcode output container. 1546 * 1547 * @since 3.6.0 1548 * 1549 * @param string $class CSS class or list of space-separated classes. 1550 */ 1442 1551 $atts = array( 1443 1552 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), … … 1481 1590 $html .= '</audio>'; 1482 1591 1592 /** 1593 * Filter the audio shortcode output. 1594 * 1595 * @since 3.6.0 1596 * 1597 * @param string $html Audio shortcode HTML output. 1598 * @param array $atts Array of audio shortcode attributes. 1599 * @param string $audio Audio file. 1600 * @param int $post_id Post ID. 1601 * @param string $library Media library used for the audio shortcode. 1602 */ 1483 1603 return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library ); 1484 1604 } … … 1492 1612 */ 1493 1613 function wp_get_video_extensions() { 1614 /** 1615 * Filter the list of supported video formats. 1616 * 1617 * @since 3.6.0 1618 * 1619 * @param array $extensions An array of support video formats. Defaults are 1620 * 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv'. 1621 */ 1494 1622 return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' ) ); 1495 1623 } … … 1616 1744 } 1617 1745 1746 /** 1747 * Filter the media library used for the video shortcode. 1748 * 1749 * @since 3.6.0 1750 * 1751 * @param string $library Media library used for the video shortcode. 1752 */ 1618 1753 $library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' ); 1619 1754 if ( 'mediaelement' === $library && did_action( 'init' ) ) { … … 1622 1757 } 1623 1758 1759 /** 1760 * Filter the class attribute for the video shortcode output container. 1761 * 1762 * @since 3.6.0 1763 * 1764 * @param string $class CSS class or list of space-separated classes. 1765 */ 1624 1766 $atts = array( 1625 1767 'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ), … … 1678 1820 1679 1821 $html = sprintf( '<div style="width: %dpx; max-width: 100%%;" class="wp-video">%s</div>', $width, $html ); 1822 1823 /** 1824 * Filter the output of the video shortcode. 1825 * 1826 * @since 3.6.0 1827 * 1828 * @param string $html Video shortcode HTML output. 1829 * @param array $atts Array of video shortcode attributes. 1830 * @param string $video Video file. 1831 * @param int $post_id Post ID. 1832 * @param string $library Media library used for the video shortcode. 1833 */ 1680 1834 return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library ); 1681 1835 } … … 1732 1886 1733 1887 $adjacent = $prev ? 'previous' : 'next'; 1888 1889 /** 1890 * Filter the adjacent image link. 1891 * 1892 * The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, 1893 * either 'next', or 'previous'. 1894 * 1895 * @since 3.5.0 1896 * 1897 * @param string $output Adjacent image HTML markup. 1898 * @param int $attachment_id Attachment ID 1899 * @param string $size Image size. 1900 * @param string $text Link text. 1901 */ 1734 1902 echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text ); 1735 1903 } … … 1867 2035 $height = min( ceil( $width * 1.5 ), 1000 ); 1868 2036 2037 /** 2038 * Filter the default array of embed dimensions. 2039 * 2040 * @since 2.9.0 2041 * 2042 * @param int $width Width of the embed in pixels. 2043 * @param int $height Height of the embed in pixels. 2044 */ 1869 2045 return apply_filters( 'embed_defaults', compact( 'width', 'height' ) ); 1870 2046 } … … 1960 2136 */ 1961 2137 function wp_maybe_load_embeds() { 1962 if ( ! apply_filters( 'load_default_embeds', true ) ) 2138 /** 2139 * Filter whether to load the default embed handlers. 2140 * 2141 * Returning a falsey value will prevent loading the default embed handlers. 2142 * 2143 * @since 2.9.0 2144 * 2145 * @param bool $maybe_load_embeds Whether to load the embeds library. Default true. 2146 */ 2147 if ( ! apply_filters( 'load_default_embeds', true ) ) { 1963 2148 return; 2149 } 2150 1964 2151 wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' ); 2152 2153 /** 2154 * Filter the audio embed handler callback. 2155 * 2156 * @since 3.6.0 2157 * 2158 * @param callback $handler Audio embed handler callback function. 2159 */ 1965 2160 wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 ); 2161 2162 /** 2163 * Filter the video embed handler callback. 2164 * 2165 * @since 3.6.0 2166 * 2167 * @param callback $handler Video embed handler callback function. 2168 */ 1966 2169 wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 ); 1967 2170 } … … 1988 2191 } 1989 2192 2193 /** 2194 * Filter the Google Video embed output. 2195 * 2196 * @since 2.9.0 2197 * 2198 * @param string $html Google Video HTML embed markup. 2199 * @param array $matches The regex matches from the provided regex. 2200 * @param array $attr An array of embed attributes. 2201 * @param string $url The original URL that was matched by the regex. 2202 * @param array $rawattr The original unmodified attributes. 2203 */ 1990 2204 return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr ); 1991 2205 } … … 2004 2218 function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) { 2005 2219 $audio = sprintf( '[audio src="%s" /]', esc_url( $url ) ); 2220 2221 /** 2222 * Filter the audio embed output. 2223 * 2224 * @since 3.6.0 2225 * 2226 * @param string $audio Audio embed output. 2227 * @param array $attr An array of embed attributes. 2228 * @param string $url The original URL that was matched by the regex. 2229 * @param array $rawattr The original unmodified attributes. 2230 */ 2006 2231 return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr ); 2007 2232 } … … 2025 2250 } 2026 2251 $video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) ); 2252 2253 /** 2254 * Filter the video embed output. 2255 * 2256 * @since 3.6.0 2257 * 2258 * @param string $video Video embed output. 2259 * @param array $attr An array of embed attributes. 2260 * @param string $url The original URL that was matched by the regex. 2261 * @param array $rawattr The original unmodified attributes. 2262 */ 2027 2263 return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr ); 2028 2264 } … … 2058 2294 $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); 2059 2295 $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ); 2060 $bytes = apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes ); 2061 return $bytes; 2296 2297 /** 2298 * Filter the maximum upload size allowed in php.ini. 2299 * 2300 * @since 2.5.0 2301 * 2302 * @param int $size Max upload size limit in bytes. 2303 * @param int $u_bytes Maximum upload filesize in bytes. 2304 * @param int $p_bytes Maximum size of POST data in bytes. 2305 */ 2306 return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes ); 2062 2307 } 2063 2308 … … 2126 2371 require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php'; 2127 2372 2128 $implementations = apply_filters( 'wp_image_editors', 2129 array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) ); 2373 /** 2374 * Filter the list of image editing library classes. 2375 * 2376 * @since 3.5.0 2377 * 2378 * @param array $image_editors List of available image editors. Defaults are 2379 * 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'. 2380 */ 2381 $implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) ); 2130 2382 2131 2383 foreach ( $implementations as $implementation ) { … … 2181 2433 $defaults['multi_selection'] = false; 2182 2434 2435 /** 2436 * Filter the Plupload default settings. 2437 * 2438 * @since 3.4.0 2439 * 2440 * @param array $defaults Default Plupload settings array. 2441 */ 2183 2442 $defaults = apply_filters( 'plupload_default_settings', $defaults ); 2184 2443 … … 2187 2446 ); 2188 2447 2448 /** 2449 * Filter the Plupload default parameters. 2450 * 2451 * @since 3.4.0 2452 * 2453 * @param array $params Default Plupload parameters array. 2454 */ 2189 2455 $params = apply_filters( 'plupload_default_params', $params ); 2190 2456 $params['_wpnonce'] = wp_create_nonce( 'media-form' ); … … 2273 2539 if ( $meta && 'image' === $type ) { 2274 2540 $sizes = array(); 2541 2275 2542 /** This filter is documented in wp-admin/includes/media.php */ 2276 2543 $possible_sizes = apply_filters( 'image_size_names_choose', array( … … 2287 2554 // way to check the image metadata, which we do second. 2288 2555 foreach ( $possible_sizes as $size => $label ) { 2556 2557 /** This filter is documented in wp-includes/media.php */ 2289 2558 if ( $downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size ) ) { 2290 2559 if ( ! $downsize[3] ) … … 2361 2630 $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) ); 2362 2631 2632 /** 2633 * Filter the attachment data prepared for JavaScript. 2634 * 2635 * @since 3.5.0 2636 * 2637 * @param array $response Array of prepared attachment data. 2638 * @param int|object $attachment Attachment ID or object. 2639 * @param array $meta Array of attachment meta data. 2640 */ 2363 2641 return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta ); 2364 2642 } … … 2393 2671 ); 2394 2672 2673 /** This filter is documented in wp-admin/includes/media.php */ 2395 2674 $tabs = apply_filters( 'media_upload_tabs', $tabs ); 2396 2675 unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] ); … … 2428 2707 'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url('media-upload.php') ), 2429 2708 'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ), 2709 /** This filter is documented in wp-admin/includes/media.php */ 2430 2710 'captions' => ! apply_filters( 'disable_captions', '' ), 2431 2711 'nonce' => array( … … 2573 2853 ); 2574 2854 2855 /** 2856 * Filter the media view settings. 2857 * 2858 * @since 3.5.0 2859 * 2860 * @param array $settings List of media view settings. 2861 * @param WP_Post $post Post object. 2862 */ 2575 2863 $settings = apply_filters( 'media_view_settings', $settings, $post ); 2576 $strings = apply_filters( 'media_view_strings', $strings, $post ); 2864 2865 /** 2866 * Filter the media view strings. 2867 * 2868 * @since 3.5.0 2869 * 2870 * @param array $strings List of media view strings. 2871 * @param WP_Post $post Post object. 2872 */ 2873 $strings = apply_filters( 'media_view_strings', $strings, $post ); 2577 2874 2578 2875 $strings['settings'] = $settings; … … 2595 2892 add_action( 'customize_controls_print_footer_scripts', 'wp_print_media_templates' ); 2596 2893 2894 /** 2895 * Fires at the conclusion of wp_enqueue_media(). 2896 * 2897 * @since 3.5.0 2898 */ 2597 2899 do_action( 'wp_enqueue_media' ); 2598 2900 } 2599 2901 2600 2902 /** 2601 * Retrieve media attached to the passed post 2903 * Retrieve media attached to the passed post. 2602 2904 * 2603 2905 * @since 3.6.0 … … 2620 2922 ); 2621 2923 2924 /** 2925 * Filter arguments used to retrieve media attached to the given post. 2926 * 2927 * @since 3.6.0 2928 * 2929 * @param array $args Post query arguments. 2930 * @param string $type Mime type of the desired media. 2931 * @param mixed $post Post ID or object. 2932 */ 2622 2933 $args = apply_filters( 'get_attached_media_args', $args, $type, $post ); 2623 2934 2624 2935 $children = get_children( $args ); 2625 2936 2937 /** 2938 * Filter the 2939 * 2940 * @since 3.6.0 2941 * 2942 * @param array $children Associative array of media attached to the given post. 2943 * @param string $type Mime type of the media desired. 2944 * @param mixed $post Post ID or object. 2945 */ 2626 2946 return (array) apply_filters( 'get_attached_media', $children, $type, $post ); 2627 2947 } … … 2655 2975 2656 2976 /** 2657 * Retrieve galleries from the passed post's content 2977 * Retrieve galleries from the passed post's content. 2658 2978 * 2659 2979 * @since 3.6.0 2660 2980 * 2661 * @param mixed$post Optional. Post ID or object.2662 * @param bool ean $html Whether to return HTML or data in the array2981 * @param int|WP_Post $post Optional. Post ID or object. 2982 * @param bool $html Whether to return HTML or data in the array. 2663 2983 * @return array A list of arrays, each containing gallery data and srcs parsed 2664 * from the expanded shortcode2984 * from the expanded shortcode. 2665 2985 */ 2666 2986 function get_post_galleries( $post, $html = true ) { … … 2696 3016 } 2697 3017 3018 /** 3019 * Filter the list of all found galleries in the given post. 3020 * 3021 * @since 3.6.0 3022 * 3023 * @param array $galleries Associative array of all found post galleries. 3024 * @param WP_Post $post Post object. 3025 */ 2698 3026 return apply_filters( 'get_post_galleries', $galleries, $post ); 2699 3027 } … … 2704 3032 * @since 3.6.0 2705 3033 * 2706 * @param mixed$post Optional. Post ID or object.2707 * @param bool ean $html Whether to return HTML or data2708 * @return string|array Gallery data and srcs parsed from the expanded shortcode 3034 * @param int|WP_Post $post Optional. Post ID or object. 3035 * @param bool $html Whether to return HTML or data. 3036 * @return string|array Gallery data and srcs parsed from the expanded shortcode. 2709 3037 */ 2710 3038 function get_post_gallery( $post = 0, $html = true ) { … … 2712 3040 $gallery = reset( $galleries ); 2713 3041 3042 /** 3043 * Filter the first-found post gallery. 3044 * 3045 * @since 3.6.0 3046 * 3047 * @param array $gallery The first-found post gallery. 3048 * @param int|WP_Post $post Post ID or object. 3049 * @param array $galleries Associative array of all found post galleries. 3050 */ 2714 3051 return apply_filters( 'get_post_gallery', $gallery, $post, $galleries ); 2715 3052 }
Note: See TracChangeset
for help on using the changeset viewer.