Changeset 15496
- Timestamp:
- 08/12/2010 11:21:05 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r15493 r15496 559 559 560 560 require_once( './includes/default-list-tables.php' ); 561 $table = new WP_Terms_Table( 'ajax');561 $table = new WP_Terms_Table(); 562 562 563 563 $level = 0; … … 627 627 628 628 require_once( './includes/default-list-tables.php' ); 629 $table = new WP_Comments_Table( 'ajax');629 $table = new WP_Comments_Table(); 630 630 631 631 global $comments; … … 660 660 661 661 require_once( './includes/default-list-tables.php' ); 662 $table = new WP_Comments_Table( 'ajax');662 $table = new WP_Comments_Table(); 663 663 664 664 global $comments; … … 686 686 687 687 require_once( './includes/default-list-tables.php' ); 688 $table = new WP_Comments_Table( 'ajax');688 $table = new WP_Comments_Table(); 689 689 690 690 $comment_post_ID = (int) $_POST['comment_post_ID']; … … 777 777 778 778 require_once( './includes/default-list-tables.php' ); 779 $table = new WP_Comments_Table( 'ajax');779 $table = new WP_Comments_Table(); 780 780 781 781 ob_start(); … … 926 926 927 927 require_once( './includes/default-list-tables.php' ); 928 $table = new WP_Users_Table( 'ajax');928 $table = new WP_Users_Table(); 929 929 930 930 $x = new WP_Ajax_Response( array( … … 1219 1219 1220 1220 require_once( './includes/default-list-tables.php' ); 1221 $table = new WP_Posts_Table( 'ajax');1221 $table = new WP_Posts_Table(); 1222 1222 1223 1223 $mode = $_POST['post_view']; … … 1229 1229 check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); 1230 1230 1231 $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false; 1232 if ( ! $taxonomy ) 1233 die( __('Cheatin’ uh?') ); 1234 $tax = get_taxonomy($taxonomy); 1235 1236 if ( ! current_user_can( $tax->cap->edit_terms ) ) 1237 die( __('Cheatin’ uh?') ); 1231 require_once( './includes/default-list-tables.php' ); 1232 $table = new WP_Terms_Table(); 1233 1234 $table->check_permissions('edit'); 1238 1235 1239 1236 if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) ) 1240 1237 die(-1); 1241 1242 $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';1243 1238 1244 1239 $tag = get_term( $id, $taxonomy ); … … 1253 1248 die( __('Item not updated.') ); 1254 1249 } 1255 1256 set_current_screen( 'edit-' . $taxonomy );1257 1258 require_once( './includes/default-list-tables.php' );1259 $table = new WP_Terms_Table( 'ajax' );1260 1250 1261 1251 echo $table->single_row( $tag, 0, $taxonomy ); -
trunk/wp-admin/edit-comments.php
r15491 r15496 10 10 require_once('./admin.php'); 11 11 12 if ( !current_user_can('edit_posts') ) 13 wp_die(__('Cheatin’ uh?')); 12 require_once( './includes/default-list-tables.php' ); 13 14 $table = new WP_Comments_Table; 15 $table->check_permissions(); 14 16 15 17 if ( isset( $_REQUEST['doaction'] ) || isset( $_REQUEST['doaction2'] ) || isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) { … … 96 98 } 97 99 98 require_once( './includes/default-list-tables.php' ); 99 100 $table = new WP_Comments_Table; 100 $table->prepare_items(); 101 101 102 102 wp_enqueue_script('admin-comments'); -
trunk/wp-admin/edit-tags.php
r15491 r15496 13 13 14 14 $table = new WP_Terms_Table; 15 $table->check_permissions(); 15 16 16 17 $title = $tax->labels->name; … … 151 152 exit; 152 153 } 154 155 $table->prepare_items(); 153 156 154 157 wp_enqueue_script('admin-tags'); -
trunk/wp-admin/edit.php
r15491 r15496 13 13 14 14 $table = new WP_Posts_Table; 15 $table->check_permissions(); 15 16 16 17 // Back-compat for viewing comments of an entry … … 118 119 $post_new_file = 'post-new.php'; 119 120 } 121 122 $table->prepare_items(); 120 123 121 124 wp_enqueue_script('inline-edit-post'); -
trunk/wp-admin/includes/default-list-tables.php
r15491 r15496 23 23 var $_hierarchical_display; 24 24 25 function WP_Posts_Table( $context = 'normal') {26 global $post_type_object, $post_type, $ avail_post_stati, $wp_query, $per_page, $mode, $current_screen;25 function WP_Posts_Table() { 26 global $post_type_object, $post_type, $current_screen; 27 27 28 28 if ( !isset( $_REQUEST['post_type'] ) ) … … 36 36 $post_type_object = get_post_type_object( $post_type ); 37 37 38 if ( !current_user_can( $post_type_object->cap->edit_posts ) )39 wp_die( __( 'Cheatin’ uh?' ) );40 41 38 parent::WP_List_Table( array( 42 39 'screen' => $current_screen, 43 40 'plural' => 'posts', 44 41 ) ); 45 46 if ( 'normal' != $context ) 47 return; 42 } 43 44 function check_permissions() { 45 global $post_type_object; 46 47 if ( !current_user_can( $post_type_object->cap->edit_posts ) ) 48 wp_die( __( 'Cheatin’ uh?' ) ); 49 } 50 51 function prepare_items() { 52 global $post_type_object, $post_type, $avail_post_stati, $wp_query, $per_page, $mode; 48 53 49 54 $avail_post_stati = wp_edit_posts_query(); … … 1073 1078 class WP_Media_Table extends WP_List_Table { 1074 1079 1075 function WP_Media_Table( $context = 'normal' ) { 1076 global $wpdb, $wp_query, $detached, $post_mime_types, $avail_post_mime_types; 1077 1078 if ( isset( $_REQUEST['find_detached'] ) ) { 1079 if ( !current_user_can( 'edit_posts' ) ) 1080 wp_die( __( 'You are not allowed to scan for lost attachments.' ) ); 1081 1082 $lost = $wpdb->get_col( " 1083 SELECT ID FROM $wpdb->posts 1084 WHERE post_type = 'attachment' AND post_parent > '0' 1085 AND post_parent NOT IN ( 1086 SELECT ID FROM $wpdb->posts 1087 WHERE post_type NOT IN ( 'attachment', '" . join( "', '", get_post_types( array( 'public' => false ) ) ) . "' ) 1088 ) 1089 " ); 1090 1091 $_REQUEST['detached'] = 1; 1092 } 1093 1094 $detached = isset( $_REQUEST['detached'] ); 1080 function WP_Media_Table() { 1081 global $detached; 1082 1083 $detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] ); 1095 1084 1096 1085 parent::WP_List_Table( array( … … 1098 1087 'plural' => 'media' 1099 1088 ) ); 1100 1101 if ( 'normal' != $context ) 1102 return; 1089 } 1090 1091 function check_permissions() { 1092 if ( !current_user_can('upload_files') ) 1093 wp_die( __( 'You do not have permission to upload files.' ) ); 1094 } 1095 1096 function prepare_items() { 1097 global $lost, $wpdb, $wp_query, $post_mime_types, $avail_post_mime_types; 1103 1098 1104 1099 $q = $_REQUEST; … … 1358 1353 } else { 1359 1354 ?> 1360 <td <?php echo $attributes ?>><?php _e( '( Unattached)' ); ?><br />1355 <td <?php echo $attributes ?>><?php _e( '(Unattached)' ); ?><br /> 1361 1356 <a class="hide-if-no-js" onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' );return false;" href="#the-list"><?php _e( 'Attach' ); ?></a></td> 1362 1357 <?php … … 1503 1498 var $callback_args; 1504 1499 1505 function WP_Terms_Table( $context = 'normal') {1500 function WP_Terms_Table() { 1506 1501 global $post_type, $taxonomy, $tax, $current_screen; 1502 1503 wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) ); 1504 1505 if ( empty( $taxonomy ) ) 1506 $taxonomy = 'post_tag'; 1507 1508 if ( !taxonomy_exists( $taxonomy ) ) 1509 wp_die( __( 'Invalid taxonomy' ) ); 1510 1511 $tax = get_taxonomy( $taxonomy ); 1512 1513 if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) ) 1514 $post_type = 'post'; 1515 1516 if ( !isset( $current_screen ) ) 1517 set_current_screen( 'edit-' . $taxonomy ); 1507 1518 1508 1519 parent::WP_List_Table( array( … … 1511 1522 'singular' => 'tag', 1512 1523 ) ); 1513 1514 if ( 'normal' != $context ) 1515 return; 1516 1517 wp_reset_vars( array( 'action', 'tag', 'taxonomy', 'post_type' ) ); 1518 1519 if ( empty( $taxonomy ) ) 1520 $taxonomy = 'post_tag'; 1521 1522 if ( !taxonomy_exists( $taxonomy ) ) 1523 wp_die( __( 'Invalid taxonomy' ) ); 1524 1525 $tax = get_taxonomy( $taxonomy ); 1526 1527 if ( ! current_user_can( $tax->cap->manage_terms ) ) 1524 } 1525 1526 function check_permissions( $type = 'manage' ) { 1527 global $tax; 1528 1529 $cap = 'manage' == $type ? $tax->cap->manage_terms : $tax->cap->edit_terms; 1530 1531 if ( !current_user_can( $tax->cap->manage_terms ) ) 1528 1532 wp_die( __( 'Cheatin’ uh?' ) ); 1529 1530 if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) ) 1531 $post_type = 'post'; 1533 } 1534 1535 function prepare_items() { 1536 global $taxonomy; 1532 1537 1533 1538 $tags_per_page = (int) get_user_option( 'edit_' . $taxonomy . '_per_page' ); … … 1852 1857 class WP_Users_Table extends WP_List_Table { 1853 1858 1854 function WP_Users_Table( $context = 'normal') {1859 function WP_Users_Table() { 1855 1860 global $role, $usersearch; 1856 1861 … … 1859 1864 'plural' => 'users' 1860 1865 ) ); 1861 1862 if ( 'normal' != $context ) 1863 return; 1864 1866 } 1867 1868 function check_permissions() { 1869 if ( !current_user_can('list_users') ) 1870 wp_die(__('Cheatin’ uh?')); 1871 } 1872 1873 function prepare_items() { 1865 1874 $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; 1866 1875 … … 2090 2099 class WP_Comments_Table extends WP_List_Table { 2091 2100 2092 function WP_Comments_Table( $context = 'normal' ) { 2093 global $comments, $extra_comments, $total_comments, $post_id, $comment_status, $mode; 2094 2095 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'detail' : $_REQUEST['mode']; 2096 2101 function WP_Comments_Table() { 2097 2102 parent::WP_List_Table( array( 2098 2103 'screen' => 'edit-comments', 2099 2104 'plural' => 'comments' 2100 2105 ) ); 2101 2102 if ( 'normal' != $context ) 2103 return; 2106 } 2107 2108 function check_permissions() { 2109 if ( !current_user_can('edit_posts') ) 2110 wp_die(__('Cheatin’ uh?')); 2111 } 2112 2113 function prepare_items() { 2114 global $comments, $extra_comments, $total_comments, $post_id, $comment_status, $mode; 2104 2115 2105 2116 $post_id = isset( $_REQUEST['post_ID'] ) ? absint( $_REQUEST['post_ID'] ) : 0; 2117 2118 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'detail' : $_REQUEST['mode']; 2106 2119 2107 2120 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; … … 2509 2522 2510 2523 function WP_Links_Table() { 2524 parent::WP_List_Table( array( 2525 'screen' => 'link-manager', 2526 'plural' => 'bookmarks', 2527 ) ); 2528 } 2529 2530 function check_permissions() { 2531 if ( ! current_user_can( 'manage_links' ) ) 2532 wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); 2533 } 2534 2535 function prepare_items() { 2511 2536 global $cat_id, $s, $orderby, $order; 2512 2537 … … 2525 2550 2526 2551 $this->items = get_bookmarks( $args ); 2527 2528 parent::WP_List_Table( array( 2529 'screen' => 'link-manager', 2530 'plural' => 'bookmarks', 2531 ) ); 2532 } 2552 } 2533 2553 2534 2554 function no_items() { … … 2691 2711 2692 2712 function WP_Sites_Table() { 2713 parent::WP_List_Table( array( 2714 'screen' => 'ms-sites', 2715 'plural' => 'sites', 2716 ) ); 2717 } 2718 2719 function check_permissions() { 2720 if ( ! current_user_can( 'manage_sites' ) ) 2721 wp_die( __( 'You do not have permission to access this page.' ) ); 2722 } 2723 2724 function prepare_items() { 2693 2725 global $s, $mode, $wpdb; 2694 2726 2695 2727 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode']; 2696 2697 parent::WP_List_Table( array(2698 'callback' => 'site_rows',2699 'screen' => 'ms-sites',2700 ) );2701 2728 2702 2729 $pagenum = $this->get_pagenum(); … … 2979 3006 2980 3007 function WP_MS_Users_Table() { 2981 global $s, $mode, $wpdb;2982 2983 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];2984 2985 3008 parent::WP_List_Table( array( 2986 3009 'screen' => 'ms-users', 2987 3010 ) ); 3011 } 3012 3013 function check_permissions() { 3014 if ( !is_multisite() ) 3015 wp_die( __( 'Multisite support is not enabled.' ) ); 3016 3017 if ( ! current_user_can( 'manage_network_users' ) ) 3018 wp_die( __( 'You do not have permission to access this page.' ) ); 3019 } 3020 3021 function prepare_items() { 3022 global $s, $mode, $wpdb; 3023 3024 $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode']; 2988 3025 2989 3026 $pagenum = $this->get_pagenum(); … … 3202 3239 3203 3240 function WP_Plugins_Table() { 3204 global $status, $plugins, $totals, $page, $orderby, $order, $s;3205 3206 3241 parent::WP_List_Table( array( 3207 3242 'screen' => 'plugins', 3208 3243 'plural' => 'plugins', 3209 3244 ) ); 3245 } 3246 3247 function check_permissions() { 3248 if ( is_multisite() ) { 3249 $menu_perms = get_site_option( 'menu_items', array() ); 3250 3251 if ( empty( $menu_perms['plugins'] ) ) { 3252 if ( !is_super_admin() ) 3253 wp_die( __( 'Cheatin’ uh?' ) ); 3254 } 3255 } 3256 3257 if ( !current_user_can('activate_plugins') ) 3258 wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); 3259 } 3260 3261 function prepare_items() { 3262 global $status, $plugins, $totals, $page, $orderby, $order, $s; 3210 3263 3211 3264 wp_reset_vars( array( 'orderby', 'order', 's' ) ); 3212 3213 $default_status = get_user_option( 'plugins_last_view' );3214 if ( empty( $default_status ) )3215 $default_status = 'all';3216 $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;3217 if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )3218 $status = 'all';3219 if ( $status != $default_status && 'search' != $status )3220 update_user_meta( get_current_user_id(), 'plugins_last_view', $status );3221 3265 3222 3266 $page = $this->get_pagenum(); … … 3539 3583 3540 3584 function WP_Plugin_Install_Table() { 3541 include( ABSPATH . 'wp-admin/includes/plugin-install.php' );3542 3543 global $tabs, $tab, $paged, $type, $term;3544 3545 3585 parent::WP_List_Table( array( 3546 3586 'screen' => 'plugin-install', 3547 3587 ) ); 3588 } 3589 3590 function check_permissions() { 3591 if ( ! current_user_can('install_plugins') ) 3592 wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 3593 } 3594 3595 function prepare_items() { 3596 include( ABSPATH . 'wp-admin/includes/plugin-install.php' ); 3597 3598 global $tabs, $tab, $paged, $type, $term; 3548 3599 3549 3600 wp_reset_vars( array( 'tab' ) ); … … 3744 3795 3745 3796 function WP_Themes_Table() { 3797 parent::__construct( array( 3798 'screen' => 'themes', 3799 ) ); 3800 } 3801 3802 function check_permissions() { 3803 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 3804 wp_die( __( 'Cheatin’ uh?' ) ); 3805 } 3806 3807 function prepare_items() { 3746 3808 global $ct; 3747 3809 … … 3758 3820 3759 3821 $this->items = array_slice( $themes, $start, $per_page ); 3760 3761 parent::__construct( array(3762 'screen' => 'themes',3763 ) );3764 3822 3765 3823 $this->set_pagination_args( array( … … 3886 3944 3887 3945 function WP_Theme_Install_Table() { 3888 include( ABSPATH . 'wp-admin/includes/theme-install.php' );3889 3890 global $tabs, $tab, $paged, $type, $term, $theme_field_defaults;3891 3892 3946 parent::WP_List_Table( array( 3893 3947 'screen' => 'theme-install', 3894 3948 ) ); 3895 3949 } 3950 3951 function check_permissions() { 3952 if ( ! current_user_can('install_themes') ) 3953 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 3954 } 3955 3956 function prepare_items() { 3957 include( ABSPATH . 'wp-admin/includes/theme-install.php' ); 3958 3959 global $tabs, $tab, $paged, $type, $term, $theme_field_defaults; 3960 3896 3961 wp_reset_vars( array( 'tab' ) ); 3897 3962 -
trunk/wp-admin/includes/list-table.php
r15491 r15496 92 92 add_action( 'admin_footer', array( $this, '_js_vars' ) ); 93 93 } 94 } 95 96 /** 97 * Checks the current user's permissions 98 * @uses wp_die() 99 * 100 * @since 3.1.0 101 * @access public 102 */ 103 function check_permissions() { 104 die( 'function WP_List_Table::check_permissions() must be over-ridden in a sub-class.' ); 105 } 106 107 /** 108 * Prepares the list of items for displaying. 109 * @uses WP_List_Table::set_pagination_args() 110 * 111 * @since 3.1.0 112 * @access public 113 */ 114 function prepare_items() { 115 die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' ); 94 116 } 95 117 … … 569 591 */ 570 592 function ajax_response() { 593 $this->check_permissions(); 594 $this->prepare_items(); 595 571 596 extract( $this->_args ); 572 597 extract( $this->_pagination_args ); -
trunk/wp-admin/link-manager.php
r15491 r15496 10 10 require_once ('admin.php'); 11 11 12 require_once( './includes/default-list-tables.php' ); 13 14 $table = new WP_Links_Table; 15 $table->check_permissions(); 16 12 17 // Handle bulk deletes 13 18 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['linkcheck'] ) ) { … … 15 20 16 21 $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2']; 17 18 if ( ! current_user_can( 'manage_links' ) )19 wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );20 22 21 23 if ( 'delete' == $doaction ) { … … 34 36 } 35 37 36 require_once( './includes/default-list-tables.php' ); 37 38 $table = new WP_Links_Table; 38 $table->prepare_items(); 39 39 40 40 $title = __('Links'); -
trunk/wp-admin/network/sites.php
r15494 r15496 13 13 wp_die( __( 'Multisite support is not enabled.' ) ); 14 14 15 if ( ! current_user_can( 'manage_sites' ) ) 16 wp_die( __( 'You do not have permission to access this page.' ) ); 15 require_once( '../includes/default-list-tables.php' ); 16 17 $table = new WP_Sites_Table; 18 $table->check_permissions(); 17 19 18 20 $title = __( 'Sites' ); … … 349 351 case 'list': 350 352 default: 351 require_once( '../includes/default-list-tables.php' ); 352 353 $table = new WP_Sites_Table; 353 $table->prepare_items(); 354 354 355 355 require_once( '../admin-header.php' ); -
trunk/wp-admin/network/users.php
r15494 r15496 10 10 require_once( './admin.php' ); 11 11 12 if ( !is_multisite() ) 13 wp_die( __( 'Multisite support is not enabled.' ) ); 12 require_once( '../includes/default-list-tables.php' ); 14 13 15 if ( ! current_user_can( 'manage_network_users' ) ) 16 wp_die( __( 'You do not have permission to access this page.' ) ); 14 $table = new WP_MS_Users_Table; 15 $table->check_permissions(); 16 $table->prepare_items(); 17 17 18 18 $title = __( 'Users' ); … … 32 32 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 33 33 ); 34 35 require_once( '../includes/default-list-tables.php' );36 37 $table = new WP_MS_Users_Table;38 34 39 35 require_once( '../admin-header.php' ); -
trunk/wp-admin/plugin-install.php
r15491 r15496 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can('install_plugins') )13 wp_die(__('You do not have sufficient permissions to install plugins on this site.'));14 15 12 require_once( './includes/default-list-tables.php' ); 16 13 17 14 $table = new WP_Plugin_Install_Table; 15 $table->check_permissions(); 16 $table->prepare_items(); 18 17 19 18 $title = __('Install Plugins'); -
trunk/wp-admin/plugins.php
r15492 r15496 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 if ( is_multisite() ) { 12 $menu_perms = get_site_option( 'menu_items', array() ); 13 14 if ( empty( $menu_perms['plugins'] ) ) { 15 if ( ! is_super_admin() ) 16 wp_die( __( 'Cheatin’ uh?' ) ); 17 } 18 } 19 20 if ( ! current_user_can( 'activate_plugins' ) ) 21 wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); 11 12 require_once( ABSPATH . 'wp-admin/includes/default-list-tables.php' ); 13 14 $table = new WP_Plugins_Table; 15 $table->check_permissions(); 22 16 23 17 if ( isset($_POST['clear-recent-list']) ) … … 300 294 } 301 295 302 require_once( ABSPATH . 'wp-admin/includes/default-list-tables.php' ); 303 304 $table = new WP_Plugins_Table; 296 $default_status = get_user_option( 'plugins_last_view' ); 297 if ( empty( $default_status ) ) 298 $default_status = 'all'; 299 $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status; 300 if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) ) 301 $status = 'all'; 302 if ( $status != $default_status && 'search' != $status ) 303 update_user_meta( get_current_user_id(), 'plugins_last_view', $status ); 304 305 $table->prepare_items(); 305 306 306 307 wp_enqueue_script('plugin-install'); -
trunk/wp-admin/theme-install.php
r15491 r15496 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can('install_themes') )13 wp_die(__('You do not have sufficient permissions to install themes on this site.'));14 15 12 require_once( './includes/default-list-tables.php' ); 16 13 17 14 $table = new WP_Theme_Install_Table; 15 $table->check_permissions(); 16 $table->prepare_items(); 18 17 19 18 $title = __('Install Themes'); -
trunk/wp-admin/themes.php
r15491 r15496 10 10 require_once('./admin.php'); 11 11 12 if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 13 wp_die( __( 'Cheatin’ uh?' ) ); 12 require_once( './includes/default-list-tables.php' ); 13 14 $table = new WP_Themes_Table; 15 $table->check_permissions(); 14 16 15 17 if ( current_user_can('switch_themes') && isset($_GET['action']) ) { … … 29 31 } 30 32 31 require_once( './includes/default-list-tables.php' ); 32 33 $table = new WP_Themes_Table; 33 $table->prepare_items(); 34 34 35 35 $title = __('Manage Themes'); -
trunk/wp-admin/upload.php
r15491 r15496 10 10 require_once( './admin.php' ); 11 11 12 if ( !current_user_can('upload_files') ) 13 wp_die(__('You do not have permission to upload files.')); 12 require_once( './includes/default-list-tables.php' ); 13 14 $table = new WP_Media_Table; 15 $table->check_permissions(); 14 16 15 17 // Handle bulk actions 16 if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) ) { 18 if ( isset($_REQUEST['find_detached']) ) { 19 check_admin_referer('bulk-media'); 20 21 if ( !current_user_can('edit_posts') ) 22 wp_die( __('You are not allowed to scan for lost attachments.') ); 23 24 $lost = $wpdb->get_col( " 25 SELECT ID FROM $wpdb->posts 26 WHERE post_type = 'attachment' AND post_parent > '0' 27 AND post_parent NOT IN ( 28 SELECT ID FROM $wpdb->posts 29 WHERE post_type NOT IN ( 'attachment', '" . join( "', '", get_post_types( array( 'public' => false ) ) ) . "' ) 30 ) 31 " ); 32 33 $_REQUEST['detached'] = 1; 34 35 } elseif ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) ) { 17 36 check_admin_referer( 'bulk-media' ); 18 37 … … 112 131 } 113 132 114 require_once( './includes/default-list-tables.php' ); 115 116 $table = new WP_Media_Table; 133 $table->prepare_items(); 117 134 118 135 $title = __('Media Library'); -
trunk/wp-admin/users.php
r15491 r15496 13 13 require_once( ABSPATH . WPINC . '/registration.php'); 14 14 15 if ( !current_user_can('list_users') ) 16 wp_die(__('Cheatin’ uh?')); 15 require_once( './includes/default-list-tables.php' ); 16 17 $table = new WP_Users_Table; 18 $table->check_permissions(); 17 19 18 20 $title = __('Users'); … … 307 309 } 308 310 309 require_once( './includes/default-list-tables.php' ); 310 311 $table = new WP_Users_Table; 311 $table->prepare_items(); 312 312 313 313 include('./admin-header.php'); -
trunk/wp-includes/functions.php
r15491 r15496 2657 2657 */ 2658 2658 function wp_die( $message, $title = '', $args = array() ) { 2659 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) 2660 die('-1'); 2661 2659 2662 if ( function_exists( 'apply_filters' ) ) { 2660 2663 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler'); 2661 } else {2664 } else { 2662 2665 $function = '_default_wp_die_handler'; 2663 2666 }
Note: See TracChangeset
for help on using the changeset viewer.