WordPress.org

Make WordPress Core

Ticket #27882: dead-code-ajax-actions.diff

File dead-code-ajax-actions.diff, 3.0 KB (added by wonderboymusic, 7 years ago)
  • src/wp-admin/includes/ajax-actions.php

     
    638638        global $wp_list_table;
    639639
    640640        check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
    641         $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
    642641        $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
    643642        $tax = get_taxonomy($taxonomy);
    644643
     
    878877        edit_comment();
    879878
    880879        $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
    881         $comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
    882 
    883880        $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
    884881        $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
    885882
     
    11221119
    11231120function wp_ajax_hidden_columns() {
    11241121        check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
    1125         $hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : '';
    1126         $hidden = explode( ',', $_POST['hidden'] );
     1122        $hidden = explode( ',', isset( $_POST['hidden'] ) ? $_POST['hidden'] : '' );
    11271123        $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
    11281124
    11291125        if ( $page != sanitize_key( $page ) )
     
    13321328
    13331329        $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) );
    13341330
    1335         $mode = $_POST['post_view'];
    1336 
    13371331        $level = 0;
    13381332        $request_post = array( get_post( $_POST['post_ID'] ) );
    13391333        $parent = $request_post[0]->post_parent;
     
    14031397        unset( $post_types['attachment'] );
    14041398
    14051399        $s = wp_unslash( $_POST['ps'] );
    1406         $searchand = $search = '';
    14071400        $args = array(
    14081401                'post_type' => array_keys( $post_types ),
    14091402                'post_status' => 'any',
     
    17091702function wp_ajax_wp_fullscreen_save_post() {
    17101703        $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
    17111704
    1712         $post = $post_type = null;
     1705        $post = null;
    17131706
    17141707        if ( $post_id )
    17151708                $post = get_post( $post_id );
    17161709
    1717         if ( $post )
    1718                 $post_type = $post->post_type;
    1719         elseif ( isset( $_POST['post_type'] ) && post_type_exists( $_POST['post_type'] ) )
    1720                 $post_type = $_POST['post_type'];
    1721 
    17221710        check_ajax_referer('update-post_' . $post_id, '_wpnonce');
    17231711
    17241712        $post_id = edit_post();
     
    19671955        if ( ! current_user_can( 'edit_post', $post_id ) )
    19681956                wp_send_json_error();
    19691957
    1970         $post = get_post( $post_id, ARRAY_A );
    1971 
    19721958        foreach ( $attachments as $attachment_id => $menu_order ) {
    19731959                if ( ! current_user_can( 'edit_post', $attachment_id ) )
    19741960                        continue;
     
    20111997        }
    20121998
    20131999        $rel = $url = '';
    2014         $html = $title = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
     2000        $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
    20152001        if ( ! empty( $attachment['url'] ) ) {
    20162002                $url = $attachment['url'];
    20172003                if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url )