WordPress.org

Make WordPress Core

Ticket #44497: 44497.diff

File 44497.diff, 518 bytes (added by bartech101, 3 years ago)
Line 
1@@ -327,6 +327,9 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
2 function get_page_link( $post = false, $leavename = false, $sample = false ) {
3        $post = get_post( $post );
4
5+       if ( is_null( $post ) ) {
6+               return _doing_it_wrong( __FUNCTION__, __( 'Invalid post ID.' ), '4.9.7' );
7+       }
8        if ( 'page' == get_option( 'show_on_front' ) && $post->ID == get_option( 'page_on_front' ) ) {
9                $link = home_url( '/' );
10        } else {