Changeset 20094 for trunk/wp-admin/includes/class-wp-themes-list-table.php
- Timestamp:
- 03/02/2012 10:09:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-themes-list-table.php
r20068 r20094 21 21 function ajax_user_can() { 22 22 // Do not check edit_theme_options here. AJAX calls for available themes require switch_themes. 23 return current_user_can( 'switch_themes');23 return current_user_can( 'switch_themes' ); 24 24 } 25 25 … … 53 53 'total_items' => count( $themes ), 54 54 'per_page' => $per_page, 55 'infinite_scroll' => true, 55 56 ) ); 56 57 } … … 203 204 return true; 204 205 } 206 207 /** 208 * Send required variables to JavaScript land 209 * 210 * @since 3.4 211 * @access private 212 * 213 * @uses $this->features Array of all feature search terms. 214 * @uses get_pagenum() 215 * @uses _pagination_args['total_pages'] 216 */ 217 function _js_vars( $extra_args = array() ) { 218 $search_string = isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : ''; 219 220 $total_pages = 1; 221 if ( ! empty( $this->_pagination_args['total_pages'] ) ) 222 $total_pages = $this->_pagination_args['total_pages']; 223 224 $args = array( 225 'search' => $search_string, 226 'features' => $this->features, 227 'paged' => $this->get_pagenum(), 228 'total_pages' => $total_pages, 229 ); 230 231 if ( is_array( $extra_args ) ) 232 $args = array_merge( $args, $extra_args ); 233 234 printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", json_encode( $args ) ); 235 parent::_js_vars(); 236 } 205 237 }
Note: See TracChangeset
for help on using the changeset viewer.