Posts, Post Types: Avoid a PHP notice in `wp_get_shortlink()` if the post type is no longer registered.
Props apedog. Fixes #51376. Built from https://develop.svn.wordpress.org/trunk@49067 git-svn-id: http://core.svn.wordpress.org/trunk@48829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f1f579199b
commit
41681b29b0
|
@ -3913,7 +3913,7 @@ function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) {
|
||||||
|
|
||||||
if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) {
|
if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) {
|
||||||
$shortlink = home_url( '/' );
|
$shortlink = home_url( '/' );
|
||||||
} elseif ( $post_type->public ) {
|
} elseif ( $post_type && $post_type->public ) {
|
||||||
$shortlink = home_url( '?p=' . $post_id );
|
$shortlink = home_url( '?p=' . $post_id );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.6-alpha-49066';
|
$wp_version = '5.6-alpha-49067';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue