Changeset 38295 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 08/20/2016 11:44:07 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r37985 r38295 1446 1446 $_post = get_post( $id ); 1447 1447 1448 if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )1448 if ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) { 1449 1449 return __( 'Missing Attachment' ); 1450 1451 if ( $permalink ) 1450 } 1451 1452 if ( $permalink ) { 1452 1453 $url = get_attachment_link( $_post->ID ); 1454 } 1453 1455 1454 1456 if ( $text ) { … … 1460 1462 } 1461 1463 1462 if ( trim( $link_text ) == '' )1464 if ( '' === trim( $link_text ) ) { 1463 1465 $link_text = $_post->post_title; 1464 1466 } 1467 1468 if ( '' === trim( $link_text ) ) { 1469 $link_text = esc_html( pathinfo( get_attached_file( $_post->ID ), PATHINFO_FILENAME ) ); 1470 } 1465 1471 /** 1466 1472 * Filters a retrieved attachment page link.
Note: See TracChangeset
for help on using the changeset viewer.