Pass the current shortcode instance ID to `post_gallery` and `post_playlist` filters.

props justincwatt.
fixes #31151.

git-svn-id: https://develop.svn.wordpress.org/trunk@31304 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-01-30 16:01:25 +00:00
parent e725b36d1e
commit 45b0513c1b
1 changed files with 8 additions and 6 deletions

View File

@ -941,10 +941,11 @@ function gallery_shortcode( $attr ) {
*
* @see gallery_shortcode()
*
* @param string $output The gallery output. Default empty.
* @param array $attr Attributes of the gallery shortcode.
* @param string $output The gallery output. Default empty.
* @param array $attr Attributes of the gallery shortcode.
* @param int $instance Unique numeric ID of this gallery shortcode instance.
*/
$output = apply_filters( 'post_gallery', '', $attr );
$output = apply_filters( 'post_gallery', '', $attr, $instance );
if ( $output != '' ) {
return $output;
}
@ -1214,10 +1215,11 @@ function wp_playlist_shortcode( $attr ) {
*
* @since 3.9.0
*
* @param string $output Playlist output. Default empty.
* @param array $attr An array of shortcode attributes.
* @param string $output Playlist output. Default empty.
* @param array $attr An array of shortcode attributes.
* @param int $instance Unique numeric ID of this playlist shortcode instance.
*/
$output = apply_filters( 'post_playlist', '', $attr );
$output = apply_filters( 'post_playlist', '', $attr, $instance );
if ( $output != '' ) {
return $output;
}