#24272 closed defect (bug) (fixed)
gallery_shortcode() can throw a "trying to get property of non-object" notice if called without a post context
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
The gallery_shortcode()
function uses $post->ID
without checking whether get_post()
returned an actual post object. If called when a post context is not set, it throws a notice. To reproduce call this inside the Debug Bar Console:
do_shortcode( '[gallery ids="1,2,3"]' );
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
In 24198: