Ticket #45329: 45329.diff
File 45329.diff, 897 bytes (added by , 6 years ago) |
---|
-
src/wp-includes/link-template.php
257 257 * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. 258 258 * @param bool $leavename Optional, defaults to false. Whether to keep post name. Default false. 259 259 * @param bool $sample Optional, defaults to false. Is it a sample permalink. Default false. 260 * @return string| WP_ErrorThe post permalink.260 * @return string|null The post permalink. 261 261 */ 262 262 function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { 263 263 global $wp_rewrite; … … 264 264 265 265 $post = get_post( $id ); 266 266 267 if ( is_wp_error( $post ) ) {267 if ( ! ( $post instanceof WP_Post ) ) { 268 268 return $post; 269 269 } 270 270