Ticket #27882: dead-code-ajax-actions.diff
File dead-code-ajax-actions.diff, 3.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
638 638 global $wp_list_table; 639 639 640 640 check_ajax_referer( 'add-tag', '_wpnonce_add-tag' ); 641 $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';642 641 $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; 643 642 $tax = get_taxonomy($taxonomy); 644 643 … … 878 877 edit_comment(); 879 878 880 879 $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 881 $comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';882 883 880 $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0; 884 881 $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) ); 885 882 … … 1122 1119 1123 1120 function wp_ajax_hidden_columns() { 1124 1121 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'] : '' ); 1127 1123 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1128 1124 1129 1125 if ( $page != sanitize_key( $page ) ) … … 1332 1328 1333 1329 $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) ); 1334 1330 1335 $mode = $_POST['post_view'];1336 1337 1331 $level = 0; 1338 1332 $request_post = array( get_post( $_POST['post_ID'] ) ); 1339 1333 $parent = $request_post[0]->post_parent; … … 1403 1397 unset( $post_types['attachment'] ); 1404 1398 1405 1399 $s = wp_unslash( $_POST['ps'] ); 1406 $searchand = $search = '';1407 1400 $args = array( 1408 1401 'post_type' => array_keys( $post_types ), 1409 1402 'post_status' => 'any', … … 1709 1702 function wp_ajax_wp_fullscreen_save_post() { 1710 1703 $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0; 1711 1704 1712 $post = $post_type =null;1705 $post = null; 1713 1706 1714 1707 if ( $post_id ) 1715 1708 $post = get_post( $post_id ); 1716 1709 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 1722 1710 check_ajax_referer('update-post_' . $post_id, '_wpnonce'); 1723 1711 1724 1712 $post_id = edit_post(); … … 1967 1955 if ( ! current_user_can( 'edit_post', $post_id ) ) 1968 1956 wp_send_json_error(); 1969 1957 1970 $post = get_post( $post_id, ARRAY_A );1971 1972 1958 foreach ( $attachments as $attachment_id => $menu_order ) { 1973 1959 if ( ! current_user_can( 'edit_post', $attachment_id ) ) 1974 1960 continue; … … 2011 1997 } 2012 1998 2013 1999 $rel = $url = ''; 2014 $html = $title =isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';2000 $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; 2015 2001 if ( ! empty( $attachment['url'] ) ) { 2016 2002 $url = $attachment['url']; 2017 2003 if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url )