How to use: WP_AJAX_GET_COMMENTS

It is being used under wp-admin/js/post.js the function commentsBox.get. The purpose is to get Post comments. The UI related to it should be shown under the Comments page of WordPress. Though if you will further check the code, the selectors aren’t present there. So there’s no way you could use it just by calling out … Read more

Hide comments from admin comments.php that user can’t edit or manage

I found another piece of code on the internet which I have modified to work. add_filter(‘the_comments’, ‘edit_comments_filter_comments’); function edit_comments_filter_comments($comments){ global $pagenow; $currentuserid = get_current_user_id(); if($pagenow == ‘edit-comments.php’ && !current_user_can(‘edit_others_posts’)){ foreach($comments as $i => $comment){ $the_post = get_post($comment->comment_post_ID); if($comment->user_id != $currentuserid && $the_post->post_author != $currentuserid) unset($comments[$i]); } } return $comments; } As I understand it, this … Read more

comments_template() doesn’t work with ajax call

I partially resolved adding this code: $args = json_decode( stripslashes( $_POST[‘query_vars’] ), true ); $args[‘paged’] = $_POST[‘page’]; //Set Query Post args query_posts( $args ); //Set Glboal Post Data global $post; $post = get_post( $_POST[‘post_id’] ); setup_postdata( $post ); //Set global $withcomment = true to execute comments_template() – using comments-ajax.php Template (Root Folder Theme) global $withcomments; … Read more

Remove rel=”nofollow ugc” from links in comments

This removes the tag before it displays the comment on the page. I tested it myself. function remove_ugc_from_links($text) { // replace ‘rel=”ugc”‘ with an empty string $new_text = str_replace(‘rel=”ugc”‘, ”, $text); return $new_text; } // Hook our function to the ‘comment_text’ filter add_filter( ‘comment_text’, ‘remove_ugc_from_links’);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)