Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (5 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r45580 r45590  
    10961096 */
    10971097function the_meta() {
    1098     if ( $keys = get_post_custom_keys() ) {
     1098    $keys = get_post_custom_keys();
     1099    if ( $keys ) {
    10991100        $li_html = '';
    11001101        foreach ( (array) $keys as $key ) {
     
    16041605    $_post = get_post( $id );
    16051606
    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 ) ) {
    16071608        return __( 'Missing Attachment' );
    16081609    }
     1610
     1611    $url = wp_get_attachment_url( $_post->ID );
    16091612
    16101613    if ( $permalink ) {
     
    18081811 */
    18091812function wp_post_revision_title( $revision, $link = true ) {
    1810     if ( ! $revision = get_post( $revision ) ) {
     1813    $revision = get_post( $revision );
     1814    if ( ! $revision ) {
    18111815        return $revision;
    18121816    }
     
    18231827    $currentf = __( '%s [Current Revision]' );
    18241828
    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>";
    18281833    }
    18291834
     
    18471852 */
    18481853function wp_post_revision_title_expanded( $revision, $link = true ) {
    1849     if ( ! $revision = get_post( $revision ) ) {
     1854    $revision = get_post( $revision );
     1855    if ( ! $revision ) {
    18501856        return $revision;
    18511857    }
     
    18611867    $gravatar = get_avatar( $revision->post_author, 24 );
    18621868
    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>";
    18661873    }
    18671874
     
    19111918 */
    19121919function 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 ) {
    19141922        return;
    19151923    }
     
    19211929    }
    19221930
    1923     if ( ! $revisions = wp_get_post_revisions( $post->ID ) ) {
     1931    $revisions = wp_get_post_revisions( $post->ID );
     1932    if ( ! $revisions ) {
    19241933        return;
    19251934    }
Note: See TracChangeset for help on using the changeset viewer.