Ticket #24258: 24258.diff
File 24258.diff, 1.9 KB (added by , 11 years ago) |
---|
-
wp-includes/link-template.php
302 302 303 303 $post = get_post( $post ); 304 304 305 if ( empty( $post ) ) 306 return null; 307 305 308 if ( $wp_rewrite->using_permalinks() && ( $post->post_parent > 0 ) && ( $post->post_parent != $post->ID ) ) { 306 $parent = get_post($post->post_parent); 309 $parent = get_post( $post->post_parent ); 310 311 if ( ! empty( $parent ) ) { 307 312 if ( 'page' == $parent->post_type ) 308 313 $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front 309 314 else 310 315 $parentlink = get_permalink( $post->post_parent ); 311 316 312 if ( is_numeric( $post->post_name) || false !== strpos(get_option('permalink_structure'), '%category%') )317 if ( is_numeric( $post->post_name ) || false !== strpos( get_option( 'permalink_structure' ), '%category%' ) ) 313 318 $name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker 314 319 else 315 320 $name = $post->post_name; 316 321 317 if ( strpos( $parentlink, '?') === false )318 $link = user_trailingslashit( trailingslashit( $parentlink) . '%postname%' );322 if ( strpos( $parentlink, '?' ) === false ) 323 $link = user_trailingslashit( trailingslashit( $parentlink ) . '%postname%' ); 319 324 320 325 if ( ! $leavename ) 321 326 $link = str_replace( '%postname%', $name, $link ); 327 328 } 329 322 330 } 323 331 324 332 if ( ! $link ) -
wp-admin/includes/class-wp-media-list-table.php
302 302 break; 303 303 304 304 case 'parent': 305 if ( $post->post_parent > 0 ) {305 if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) { 306 306 if ( get_post( $post->post_parent ) ) { 307 307 $title =_draft_or_post_title( $post->post_parent ); 308 308 }