Make WordPress Core

Opened 11 years ago

Closed 3 years ago

#34559 closed defect (bug) (invalid)

get_post_galleries does not return the galleries properly

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

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
11 years ago

  • Focuses accessibility removed

#2 @swissspidy
11 years ago

  • Component General → Shortcodes
  • Focuses administration removed

#3 @zex2911
3 years ago

  • Resolution → invalid
  • Status new → 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.