WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 6 months ago

#34559 new defect (bug)

get_post_galleries does not return the galleries properly

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

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 (2)

#1 @joedolson
4 years ago

  • Focuses accessibility removed

#2 @swissspidy
4 years ago

  • Component changed from General to Shortcodes
  • Focuses administration removed
Note: See TracTickets for help on using tickets.