From bb51b4e2390262cb9a1b2dad3cf6fadc8d517394 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 8 May 2013 16:57:58 +0000 Subject: [PATCH] Avoid warning in gallery_shortcode() when called outside of post context. Props kovshenin fixes #24272 git-svn-id: http://core.svn.wordpress.org/trunk@24198 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 52037b959a..1addcdcc3e 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -697,7 +697,7 @@ function gallery_shortcode($attr) { extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', - 'id' => $post->ID, + 'id' => $post ? $post->ID : 0, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd',