WordPress.org

Make WordPress Core

Ticket #18235: 18235.patch

File 18235.patch, 2.9 KB (added by azaozz, 7 years ago)

Marked the places with old and redundant code

  • wp-admin/edit-form-advanced.php

     
    2323 * @var int
    2424 */
    2525$post_ID = isset($post_ID) ? (int) $post_ID : 0;
     26
     27// redundant code
    2628$temp_ID = isset($temp_ID) ? (int) $temp_ID : 0;
     29// end redundant code
     30
    2731$user_ID = isset($user_ID) ? (int) $user_ID : 0;
    2832$action = isset($action) ? $action : '';
    2933
  • wp-admin/includes/post.php

     
    234234
    235235        wp_update_post( $post_data );
    236236
     237// redundant code       
    237238        // Reunite any orphaned attachments with their parent
    238239        if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
    239240                $draft_ids = array();
     
    242243
    243244        // Now that we have an ID we can fix any attachment anchor hrefs
    244245        _fix_attachment_links( $post_ID );
     246// end redundant code
    245247
    246248        wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
    247249
     
    551553        // Clear out any data in internal vars.
    552554        unset( $_POST['filter'] );
    553555
     556
     557// redundant code
    554558        // Check for autosave collisions
    555559        // Does this need to be updated? ~ Mark
    556560        $temp_id = false;
     
    569573                        return edit_post();
    570574                }
    571575        }
     576// end redundant code
    572577
     578
    573579        // Edit don't write if we have a post id.
    574580        if ( isset( $_POST['ID'] ) ) {
    575581                $_POST['post_ID'] = $_POST['ID'];
     
    611617
    612618        add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID );
    613619
     620
     621// redundant code
    614622        // Reunite any orphaned attachments with their parent
    615623        // Does this need to be udpated? ~ Mark
    616624        if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
     
    628636
    629637        // Now that we have an ID we can fix any attachment anchor hrefs
    630638        _fix_attachment_links( $post_ID );
     639// end redundant code
    631640
     641
    632642        wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
    633643
    634644        return $post_ID;
     
    809819// Private
    810820//
    811821
     822
     823// redundant code: we have had $post_ID always set for quite some time now. Time to remove these back-compat?
    812824/**
    813825 * Replace hrefs of attachment anchors with up-to-date permalinks.
    814826 *
     
    891903                delete_post_meta($child_id, '_wp_attachment_temp_parent');
    892904        }
    893905}
     906// end redundant code
    894907
     908
     909
    895910/**
    896911 * Get all the possible statuses for a post_type
    897912 *
  • wp-includes/post.php

     
    37273727
    37283728        clean_post_cache($post_ID);
    37293729
     3730
     3731// redundant code
    37303732        if ( isset($post_parent) && $post_parent < 0 )
    37313733                add_post_meta($post_ID, '_wp_attachment_temp_parent', $post_parent, true);
     3734// end redundant code
    37323735
     3736
    37333737        if ( ! empty( $context ) )
    37343738                add_post_meta( $post_ID, '_wp_attachment_context', $context, true );
    37353739