#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: | kovshenin | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Media | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 24198: