Changeset 7352 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 03/17/2008 10:18:32 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-ajax.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r7336 r7352 23 23 $id = isset($_POST['id'])? (int) $_POST['id'] : 0; 24 24 switch ( $action = $_POST['action'] ) : 25 case 'add-post' :26 check_ajax_referer( 'add-post' );27 add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; $start += intval(trim($b[2])) - 1; return "LIMIT $start, 1";' ) );28 wp_edit_posts_query( $_POST );29 if ( !have_posts() )30 die('1');31 $posts_columns = wp_manage_posts_columns();32 ob_start();33 include( 'edit-post-rows.php' );34 $data = ob_get_contents();35 ob_end_clean();36 if ( !preg_match('|<tbody.+?>(.+)</tbody>|s', $data, $matches) )37 my_dump($data);38 $data = trim($matches[1]);39 $x = new WP_Ajax_Response( array( 'what' => 'post', 'id' => $id, 'data' => $data ) );40 $x->send();41 break;42 25 case 'delete-comment' : 43 26 check_ajax_referer( "delete-comment_$id" );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)