jquery for list manipulation. Round one, fight. Props mdawaffe. fixes #4805

git-svn-id: https://develop.svn.wordpress.org/trunk@6213 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-10-09 22:49:42 +00:00
parent 1e41dc0c9e
commit 490789554f
27 changed files with 453 additions and 377 deletions

View File

@@ -696,11 +696,13 @@ class WP_Ajax_Response {
$defaults = array(
'what' => 'object', 'action' => false,
'id' => '0', 'old_id' => false,
'position' => 1, // -1 = top, 1 = bottom, html ID = after, -html ID = before
'data' => '', 'supplemental' => array()
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$postition = preg_replace( '/[^a-z0-9:_-]/i', '', $position );
if ( is_wp_error($id) ) {
$data = $id;
@@ -724,7 +726,7 @@ class WP_Ajax_Response {
$x = '';
$x .= "<response action='{$action}_$id'>"; // The action attribute in the xml output is formatted like a nonce action
$x .= "<$what id='$id'" . ( false !== $old_id ? "old_id='$old_id'>" : '>' );
$x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
$x .= $response;
$x .= $s;
$x .= "</$what>";