Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_ajax_edit_comment [ WordPress Function ]

wp_ajax_edit_comment ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_edit_comment() {
    global 
$wp_list_table;

    
check_ajax_referer'replyto-comment''_ajax_nonce-replyto-comment' );

    
set_current_screen'edit-comments' );

    
$comment_id = (int) $_POST['comment_ID'];
    if ( ! 
current_user_can'edit_comment'$comment_id ) )
        
wp_die( -);

    if ( 
'' == $_POST['content'] )
        
wp_die__'ERROR: please type a comment.' ) );

    
$_POST['comment_status'] = $_POST['status'];
    
edit_comment();

    
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
    
$comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';

    
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 0;
    
$wp_list_table _get_list_table$checkbox 'WP_Comments_List_Table' 'WP_Post_Comments_List_Table' );

    
$comment get_comment$comment_id );

    
ob_start();
        
$wp_list_table->single_row$comment );
        
$comment_list_item ob_get_contents();
    
ob_end_clean();

    
$x = new WP_Ajax_Response();

    
$x->add( array(
        
'what' => 'edit_comment',
        
'id' => $comment->comment_ID,
        
'data' => $comment_list_item,
        
'position' => $position
    
));

    
$x->send();
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics