Paste URL In comment It auto turn to default title of page with link
Paste URL In comment It auto turn to default title of page with link
Paste URL In comment It auto turn to default title of page with link
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
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
My comments are blank in the backend
Why does the reply link in comments template scroll to comment position?
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’);
The code you’ve provided does remove the website URL field from the comment form. However, bots can still directly POST to the wp-comments-post.php file with a URL included. To prevent this, you can remove the URL from the submitted data before it’s saved to the database. You can achieve this using the preprocess_comment filter. Add … Read more
I think you’re close with your 2nd snippet, but you should be using meta_value_num instead of meta_key_num. $query->set( ‘meta_key’, ‘comment_karma’ ); $query->set( ‘orderby’, ‘meta_value_num’ ); See the WP_Query orderby docs for more info.
The rel=ugc is added by a default filter on pre_comment_content. You can disable this by adding the following line to your functions.php: remove_filter (‘pre_comment_content’, ‘wp_rel_ugc’, 20); This may not be wise. If at some point you change your mind, you would have to go through all comments to add it. It is problably better to … Read more
You can do that by using the comment_text filter. It runs for each comment, so with some regex you can find all links in the comment and loop through them. You make one more check to make sure the link has an image extension (jpg, jpeg, png, etc). If it does, we can embed it … Read more