Make WordPress Core

Opened 9 years ago

Closed 19 months ago

#34559 closed defect (bug) (invalid)

get_post_galleries does not return the galleries properly

Reported by: darius00klokj's profile darius00klokj Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: Shortcodes Keywords:
Focuses: Cc:

Description

The function get_post_galleries is missing:

<?php
elseif ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], 'gallery' ) ) {

and iterate on the content returned by $shortcode[5].

This occures when the galleries are within anther shortcode, example:

[block_div]
some text [gallery ids="1,2,3"]
[/block_div]

in the example the above the has_shortcode will return true, but the get_post_galleries will be an empty array.

Change History (3)

#1 @joedolson
9 years ago

  • Focuses accessibility removed

#2 @swissspidy
9 years ago

  • Component changed from General to Shortcodes
  • Focuses administration removed

#3 @zex2911
19 months ago

  • Resolution set to invalid
  • Status changed from new to closed

To properly nest shortcodes inside of other shortcodes we need to nest them. This is done in the outer shortcode, as outlined in the documentation on nested shortcodes

The parser won't see the inner shortcode as a shortcode, but as a part of the content, unless we use do_shortcode() to display the outer shortcode's content.

Note: See TracTickets for help on using tickets.