diff --git wp-includes/class-wp-embed.php wp-includes/class-wp-embed.php
index 275c280..94db0bf 100644
|
|
|
class WP_Embed { |
| 130 | 130 | * @uses get_post_meta() |
| 131 | 131 | * @uses update_post_meta() |
| 132 | 132 | * |
| 133 | | * @param array $attr Shortcode attributes. |
| | 133 | * @param array $attr { |
| | 134 | * Shortcode attributes. Optional. |
| | 135 | * |
| | 136 | * @type int $width The width of the embed in pixels. |
| | 137 | * @type int $height The height of the embed in pixels. |
| | 138 | * } |
| 134 | 139 | * @param string $url The URL attempting to be embedded. |
| 135 | 140 | * @return string The embed HTML on success, otherwise the original URL. |
| 136 | 141 | */ |
| … |
… |
class WP_Embed { |
| 160 | 165 | * |
| 161 | 166 | * @param mixed $return The shortcode callback function to call. |
| 162 | 167 | * @param string $url The attempted embed URL. |
| 163 | | * @param array $attr An array of shortcode attributes. |
| | 168 | * @param array $attr An array of shortcode attributes. @see WP_Embed::shortcode() |
| 164 | 169 | */ |
| 165 | 170 | return apply_filters( 'embed_handler_html', $return, $url, $attr ); |
| 166 | 171 | } |
| … |
… |
class WP_Embed { |
| 191 | 196 | * |
| 192 | 197 | * @param mixed $cache The cached HTML result, stored in post meta. |
| 193 | 198 | * @param string $url The attempted embed URL. |
| 194 | | * @param array $attr An array of shortcode attributes. |
| | 199 | * @param array $attr An array of shortcode attributes. @see WP_Embed::shortcode() |
| 195 | 200 | * @param int $post_ID Post ID. |
| 196 | 201 | */ |
| 197 | 202 | return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID ); |
diff --git wp-includes/media.php wp-includes/media.php
index 8e150a5..b99096b 100644
|
|
|
add_shortcode('caption', 'img_caption_shortcode'); |
| 623 | 623 | * |
| 624 | 624 | * @since 2.6.0 |
| 625 | 625 | * |
| 626 | | * @param array $attr Attributes attributed to the shortcode. |
| | 626 | * @param array $attr { |
| | 627 | * Attributes of the caption shortcode. |
| | 628 | * |
| | 629 | * @type string $id The ID of the div element for the caption. |
| | 630 | * @type string $align The class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft', |
| | 631 | * 'aligncenter', alignright', 'alignnone'. |
| | 632 | * @type int $width The width of the caption. |
| | 633 | * @type string $caption The caption text. |
| | 634 | * } |
| 627 | 635 | * @param string $content Optional. Shortcode content. |
| 628 | 636 | * @return string |
| 629 | 637 | */ |
| … |
… |
function img_caption_shortcode($attr, $content = null) { |
| 636 | 644 | } |
| 637 | 645 | } |
| 638 | 646 | |
| 639 | | // Allow plugins/themes to override the default caption template. |
| 640 | | $output = apply_filters('img_caption_shortcode', '', $attr, $content); |
| | 647 | /** |
| | 648 | * Allow plugins/themes to short-circuit the default caption template. |
| | 649 | * |
| | 650 | * If the filtered output isn't empty, it will be used instead of generating the default caption template. |
| | 651 | * |
| | 652 | * @since 2.6.0 |
| | 653 | * |
| | 654 | * @param string $output The caption output. Default ''. |
| | 655 | * @param array $attr Attributes of the caption shortcode. @see img_caption_shortcode() |
| | 656 | * @param string $content The image element, possibly wrapped in a hyperlink. |
| | 657 | */ |
| | 658 | $output = ''; |
| | 659 | $output = apply_filters( 'img_caption_shortcode', $output, $attr, $content ); |
| 641 | 660 | if ( $output != '' ) |
| 642 | 661 | return $output; |
| 643 | 662 | |
| … |
… |
function img_caption_shortcode($attr, $content = null) { |
| 665 | 684 | * |
| 666 | 685 | * @since 3.7.0 |
| 667 | 686 | * |
| 668 | | * @param int $caption_width Width in pixels. To remove this inline style, return zero. |
| 669 | | * @param array $atts { |
| 670 | | * The attributes of the caption shortcode. |
| 671 | | * |
| 672 | | * @type string 'id' The ID of the div element for the caption. |
| 673 | | * @type string 'align' The class name that aligns the caption. Default 'alignnone'. |
| 674 | | * @type int 'width' The width of the image being captioned. |
| 675 | | * @type string 'caption' The image's caption. |
| 676 | | * } |
| 677 | | * @param string $content The image element, possibly wrapped in a hyperlink. |
| | 687 | * @param int $caption_width Width in pixels. To remove this inline style, return zero. |
| | 688 | * @param array $atts Attributes of the caption shortcode. @see img_caption_shortcode() |
| | 689 | * @param string $content The image element, possibly wrapped in a hyperlink. |
| 678 | 690 | */ |
| 679 | 691 | $caption_width = apply_filters( 'img_caption_shortcode_width', $caption_width, $atts, $content ); |
| 680 | 692 | |
| … |
… |
add_shortcode('gallery', 'gallery_shortcode'); |
| 696 | 708 | * |
| 697 | 709 | * @since 2.5.0 |
| 698 | 710 | * |
| 699 | | * @param array $attr Attributes of the shortcode. |
| | 711 | * @param array $attr { |
| | 712 | * Attributes of the gallery shortcode. |
| | 713 | * |
| | 714 | * @type string $order The order of the images in the gallery. Default 'ASC'. Accepts 'ASC', 'DESC'. |
| | 715 | * @type string $orderby The field to use when ordering the images. Default 'menu_order ID'. Accepts any |
| | 716 | * valid SQL ORDERBY statement. |
| | 717 | * @type int $id The post ID. Default The current post ID. |
| | 718 | * @type string $itemtag The HTML tag to use for each image in the gallery. Default 'dl'. |
| | 719 | * @type string $icontag The HTML tag to use for each image's icon. Default 'dt'. |
| | 720 | * @type string $captiontag The HTML tag to use for each image's caption. Default 'dd'. |
| | 721 | * @type int $columns The number of columns of images to display. Default 3. |
| | 722 | * @type string $size The size of the images to display. Default 'thumbnail'. |
| | 723 | * @type string $ids A comma-separated list of IDs of attachments to display. Default ''. |
| | 724 | * @type string $include A comma-separated list of IDs of attachments to include. Default ''. |
| | 725 | * @type string $exclude A comma-separated list of IDs of attachments to exclude. Default ''. |
| | 726 | * @type string $link What to link each image to. Default '' (links to the attachment page). Accepts 'file', 'none'. |
| | 727 | * } |
| 700 | 728 | * @return string HTML content to display gallery. |
| 701 | 729 | */ |
| 702 | 730 | function gallery_shortcode($attr) { |
| … |
… |
function gallery_shortcode($attr) { |
| 712 | 740 | $attr['include'] = $attr['ids']; |
| 713 | 741 | } |
| 714 | 742 | |
| 715 | | // Allow plugins/themes to override the default gallery template. |
| 716 | | $output = apply_filters('post_gallery', '', $attr); |
| | 743 | /** |
| | 744 | * Allow plugins/themes to short-circuit the default gallery template. |
| | 745 | * |
| | 746 | * If the filtered output isn't empty, it will be used instead of generating the default gallery template. |
| | 747 | * |
| | 748 | * @since 2.5.0 |
| | 749 | * |
| | 750 | * @param string $output The gallery output. Default ''. |
| | 751 | * @param array $attr Attributes of the gallery shortcode. @see gallery_shortcode() |
| | 752 | */ |
| | 753 | $output = apply_filters( 'post_gallery', '', $attr ); |
| 717 | 754 | if ( $output != '' ) |
| 718 | 755 | return $output; |
| 719 | 756 | |
| … |
… |
function wp_get_audio_extensions() { |
| 875 | 912 | * |
| 876 | 913 | * @since 3.6.0 |
| 877 | 914 | * |
| 878 | | * @param array $attr Attributes of the shortcode. |
| | 915 | * @param array $attr { |
| | 916 | * Attributes of the shortcode. |
| | 917 | * |
| | 918 | * @type string $src The URL to the source of the audio file. Default ''. |
| | 919 | * @type string $loop The 'loop' attribute for the `<audio>` element. Default ''. |
| | 920 | * @type string $autoplay The 'autoplay' attribute for the `<audio>` element. Default ''. |
| | 921 | * @type string $preload The 'preload' attribute for the `<audio>` element. Default ''. |
| | 922 | * @type string $class The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'. |
| | 923 | * @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instances}'. |
| | 924 | * @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'. |
| | 925 | * } |
| 879 | 926 | * @param string $content Optional. Shortcode content. |
| 880 | 927 | * @return string HTML content to display audio. |
| 881 | 928 | */ |
| … |
… |
function wp_audio_shortcode( $attr, $content = '' ) { |
| 886 | 933 | $instances++; |
| 887 | 934 | |
| 888 | 935 | /** |
| 889 | | * Override the default audio shortcode. |
| | 936 | * Short-circuit the default audio template. |
| 890 | 937 | * |
| 891 | | * @since 3.7.0 |
| | 938 | * If the filtered output isn't empty, it will be used instead of generating the default audio template. |
| | 939 | * |
| | 940 | * @since 3.6.0 |
| 892 | 941 | * |
| 893 | | * @param null Empty variable to be replaced with shortcode markup. |
| 894 | | * @param array $attr Attributes of the shortcode. |
| | 942 | * @param string $html Empty variable to be replaced with shortcode markup. |
| | 943 | * @param array $attr Attributes of the shortcode. @see wp_audio_shortcode() |
| 895 | 944 | * @param string $content Shortcode content. |
| 896 | 945 | * @param int $instances Unique numeric ID of this audio shortcode instance. |
| 897 | 946 | */ |
| 898 | | $html = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances ); |
| | 947 | $html = ''; |
| | 948 | $html = apply_filters( 'wp_audio_shortcode_override', $html, $attr, $content, $instances ); |
| 899 | 949 | if ( '' !== $html ) |
| 900 | 950 | return $html; |
| 901 | 951 | |
| … |
… |
function wp_get_video_extensions() { |
| 1012 | 1062 | * |
| 1013 | 1063 | * @since 3.6.0 |
| 1014 | 1064 | * |
| 1015 | | * @param array $attr Attributes of the shortcode. |
| | 1065 | * @param array $attr { |
| | 1066 | * Attributes of the shortcode. |
| | 1067 | * |
| | 1068 | * @type string $src The URL to the source of the video file. Default ''. |
| | 1069 | * @type int $height The height of the video embed in pixels. Default 360. |
| | 1070 | * @type int $width The width of the video embed in pixels. Default $content_width or 640. |
| | 1071 | * @type string $poster The 'poster' attribute for the `<video>` element. Default ''. |
| | 1072 | * @type string $loop The 'loop' attribute for the `<video>` element. Default ''. |
| | 1073 | * @type string $autoplay The 'autoplay' attribute for the `<video>` element. Default ''. |
| | 1074 | * @type string $preload The 'preload' attribute for the `<video>` element. Default 'metadata'. |
| | 1075 | * @type string $class The 'class' attribute for the `<video>` element. Default 'wp-video-shortcode'. |
| | 1076 | * @type string $id The 'id' attribute for the `<video>` element. Default 'video-{$post_id}-{$instances}'. |
| | 1077 | * } |
| 1016 | 1078 | * @param string $content Optional. Shortcode content. |
| 1017 | 1079 | * @return string HTML content to display video. |
| 1018 | 1080 | */ |
| … |
… |
function wp_video_shortcode( $attr, $content = '' ) { |
| 1024 | 1086 | $instances++; |
| 1025 | 1087 | |
| 1026 | 1088 | /** |
| 1027 | | * Override the default video shortcode. |
| | 1089 | * Short-circuit the default video template. |
| 1028 | 1090 | * |
| 1029 | | * @since 3.7.0 |
| | 1091 | * If the filtered output isn't empty, it will be used instead of generating the default video template. |
| 1030 | 1092 | * |
| 1031 | | * @param null Empty variable to be replaced with shortcode markup. |
| 1032 | | * @param array $attr Attributes of the shortcode. |
| | 1093 | * @since 3.6.0 |
| | 1094 | * |
| | 1095 | * @param string $html Empty variable to be replaced with shortcode markup. |
| | 1096 | * @param array $attr Attributes of the shortcode. @see wp_video_shortcode() |
| 1033 | 1097 | * @param string $content Shortcode content. |
| 1034 | 1098 | * @param int $instances Unique numeric ID of this video shortcode instance. |
| 1035 | 1099 | */ |
| 1036 | | $html = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instances ); |
| | 1100 | $html = ''; |
| | 1101 | $html = apply_filters( 'wp_video_shortcode_override', $html, $attr, $content, $instances ); |
| 1037 | 1102 | if ( '' !== $html ) |
| 1038 | 1103 | return $html; |
| 1039 | 1104 | |