wp_ajax_edit_comment [ WordPress Function ]
wp_ajax_edit_comment ( No parameters )
| Defined at: |
|
Soorgelijke functies: wp_ajax_dim_comment, wp_ajax_get_comments, wp_ajax_delete_comment, wp_ajax_replyto_comment, edit_comment
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( -1 );
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'] ) ? 1 : 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
- WordPress › WP Ajax Edit Comments « WordPress Plugins
Jan 19, 2012 ... Description · Installation · FAQ · Screenshots · Changelog · Stats · Support · Developers. Users can edit their own comments for a limited time, ...
wordpress.org - WordPress › Support » WP-Ajax-Edit Comment with built-in Ajax ...
WP-Ajax-Edit Comment with built-in Ajax Comment (9 posts). dustyhawk. Member Posted 4 years ago #. The plugin works fine. However the text that says a user ...
wordpress.org - PHPXRef 0.7 : WordPress : Detail view of ajax-actions.php
wp_ajax_add_link_category() wp_ajax_add_tag() wp_ajax_get_tagcloud() wp_ajax_get_comments() wp_ajax_replyto_comment() wp_ajax_edit_comment() ...
phpxref.ftwr.co.uk - AjaxBerlee 1.3a WordPress Theme | Nico.Berlee.nl
May 19, 2007 ... Quote from the WP Ajax Edit Comment site: Since the plugin requires JavaScript and the DOM (Document Object Model), Ajax-type posted ...
nico.berlee.nl