Make WordPress Core


Ignore:
Timestamp:
03/17/2008 10:18:32 PM (18 years ago)
Author:
ryan
Message:

Display 15 posts. Remove no longer needed add-post AJAX action. Props johnhennmacc. fixes #6264

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r7336 r7352  
    2323$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
    2424switch ( $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;
    4225case 'delete-comment' :
    4326        check_ajax_referer( "delete-comment_$id" );
Note: See TracChangeset for help on using the changeset viewer.