mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Make sure the post global is actually an object before we treat it like one.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8a80bffbae
commit
81552ba995
@ -987,7 +987,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) {
|
function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) {
|
||||||
if ( $previous && is_attachment() )
|
if ( $previous && is_attachment() && is_object( $GLOBALS['post'] ) )
|
||||||
$post = & get_post($GLOBALS['post']->post_parent);
|
$post = & get_post($GLOBALS['post']->post_parent);
|
||||||
else
|
else
|
||||||
$post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
|
$post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
|
||||||
|
Loading…
Reference in New Issue
Block a user