Changeset 45590 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 07/02/2019 11:41:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r45580 r45590 1096 1096 */ 1097 1097 function the_meta() { 1098 if ( $keys = get_post_custom_keys() ) { 1098 $keys = get_post_custom_keys(); 1099 if ( $keys ) { 1099 1100 $li_html = ''; 1100 1101 foreach ( (array) $keys as $key ) { … … 1604 1605 $_post = get_post( $id ); 1605 1606 1606 if ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! $url =wp_get_attachment_url( $_post->ID ) ) {1607 if ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! wp_get_attachment_url( $_post->ID ) ) { 1607 1608 return __( 'Missing Attachment' ); 1608 1609 } 1610 1611 $url = wp_get_attachment_url( $_post->ID ); 1609 1612 1610 1613 if ( $permalink ) { … … 1808 1811 */ 1809 1812 function wp_post_revision_title( $revision, $link = true ) { 1810 if ( ! $revision = get_post( $revision ) ) { 1813 $revision = get_post( $revision ); 1814 if ( ! $revision ) { 1811 1815 return $revision; 1812 1816 } … … 1823 1827 $currentf = __( '%s [Current Revision]' ); 1824 1828 1825 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1826 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) { 1827 $date = "<a href='$link'>$date</a>"; 1829 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1830 $edit_link = get_edit_post_link( $revision->ID ); 1831 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) { 1832 $date = "<a href='$edit_link'>$date</a>"; 1828 1833 } 1829 1834 … … 1847 1852 */ 1848 1853 function wp_post_revision_title_expanded( $revision, $link = true ) { 1849 if ( ! $revision = get_post( $revision ) ) { 1854 $revision = get_post( $revision ); 1855 if ( ! $revision ) { 1850 1856 return $revision; 1851 1857 } … … 1861 1867 $gravatar = get_avatar( $revision->post_author, 24 ); 1862 1868 1863 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1864 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) { 1865 $date = "<a href='$link'>$date</a>"; 1869 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1870 $edit_link = get_edit_post_link( $revision->ID ); 1871 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) { 1872 $date = "<a href='$edit_link'>$date</a>"; 1866 1873 } 1867 1874 … … 1911 1918 */ 1912 1919 function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { 1913 if ( ! $post = get_post( $post_id ) ) { 1920 $post = get_post( $post_id ); 1921 if ( ! $post ) { 1914 1922 return; 1915 1923 } … … 1921 1929 } 1922 1930 1923 if ( ! $revisions = wp_get_post_revisions( $post->ID ) ) { 1931 $revisions = wp_get_post_revisions( $post->ID ); 1932 if ( ! $revisions ) { 1924 1933 return; 1925 1934 }
Note: See TracChangeset
for help on using the changeset viewer.