mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Make sure the queried object is non-null before accessing its properties.
Props markoheijnen, ryan. Fixes #21394. git-svn-id: https://develop.svn.wordpress.org/trunk@25310 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -256,7 +256,8 @@ function get_page_template() {
|
||||
if ( ! $pagename && $id ) {
|
||||
// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
|
||||
$post = get_queried_object();
|
||||
$pagename = $post->post_name;
|
||||
if ( $post )
|
||||
$pagename = $post->post_name;
|
||||
}
|
||||
|
||||
$templates = array();
|
||||
|
||||
Reference in New Issue
Block a user