mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Relocate isset check. Props TobiasBg, SergeyBiryukov. fixes #15041
git-svn-id: http://svn.automattic.com/wordpress/trunk@17076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
708153f294
commit
cb88352144
@ -185,11 +185,11 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
|
||||
|
||||
$slug = $post->post_name;
|
||||
|
||||
$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
||||
$draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
||||
|
||||
$post_type = get_post_type_object($post->post_type);
|
||||
|
||||
if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
|
||||
if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
|
||||
if ( ! $leavename ) {
|
||||
if ( $post_type->hierarchical )
|
||||
$slug = get_page_uri($id);
|
||||
|
Loading…
Reference in New Issue
Block a user