Tag Info

Hot answers tagged

6

Pingbacks/Trackbacks: This is most likely a harmless case of link notifications to your blog (A) from the other blog (B), where: the comment_author_email field is usually empty, the comment_type field is either pingback or trackback, the comment_author field has the form: The title of the post that contains a link to a post of blog A | The site ...


4

Preface Once post preview is frontend, the comment form depends on how theme handle it. I will assume in this answer that the comment form is shown using the standard comment_form() function. The previous assumption isn't enough, in fact comment_form is probably the function in WordPress core with more hooks. There is almost an hook for every line. So what ...


4

When we post an empty anonymous reply, we get the following errors: The part of BBPress that's responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter ...


3

This can be used, mainly by plugins, to add some additional information to a comment. By having one generic table you don't need to add columns to wp_comment for every additional piece of data. E.g. a plugin could add a rating to each comment and store that value in wp_commentmeta.


3

That table is essentially the same as for all of the other "meta" tables in the WordPress architecture. It holds misc. bits of extra, usually optional, information about the associated post, user, or in this case comment. You can store whatever information you need to add to a comment-- perhaps a plugin wants to implement "abuse" flags, or comment upvotes. ...


2

There is a plugin with that readers can post comments inline, like in Microsoft Word. The WordPress plugin bases on inlineDisqussions by Tsi and is called Inline Comments: http://wordpress.org/plugins/inline-comments/ Inline Comments adds the great Disqus Comment System to the side of paragraphs and other specific sections (like headlines and images) of ...


2

Well, this is partly true and partly false. When you trash a post, everything that is tied to it is also trashed. This means, if you untrash the post, the comments etc. are untrashed as well. However, comments and other stuff is not handled as if they were trashed directly (i.e., on the Comments page in your WordPress Admin). If you directly trash a ...


2

Basically it's just a request using the WP HTTP API using its functions. Something along the lines of: $response = wp_remote_get( $disqusURLwithArgs, array( /* API args */ ) ); // Additional checks like wp_remote_retrieve_resonse_code // or wp_remote_retrieve_response_message // and is_wp_error( $response ) $content = wp_remote_retrieve_body( $response ); ...


2

You can use a filter to pre_get_posts so that only your posts are listed. Something like this: function my_posts_only( $query ) { global $pagenow; if ( 'edit.php' != $pagenow || ! $query->is_admin ) return $query; if ( ! current_user_can( 'manage_options' ) ) { global $user_ID; $query->set( 'author', $user_ID ); ...


2

You can use the get_comment_author_link hook, which is part of the get_comment_author_link() template tag, like your question already suggests. Then you only have to get the according user_id, which can be done via the $comment global, and construct the link you want accordingly. Exemplary usage like shown below: add_filter( 'get_comment_author_link', ...


2

I skimmed through the source of the wp_notify_postauthor() function and noticed the comment_notification_recipients filter. I wonder if you could simplify your plugin to the following code snippet: <?php /** * Plugin Name: Disable comment/trackback/pingback notifications emails * Plugin URI: http://wordpress.stackexchange.com/a/150141/26350 */ ...


2

Yes, alter the single-debate.php and call a custom comment template using comment_template with a parameter, representing your custom comment template. <?php // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || '0' != get_comments_number() ) comments_template('custom-comments.php'); ?>


2

Debug ideas: You could try to see if this has any effect: add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' ); But you should check out the parameters that go through the bp_core_fetch_avatar filter to see if they are correct (untested): add_filter( 'bp_core_fetch_avatar', 'my_bp_core_fetch_avatar', 99, 9 ); function my_bp_core_fetch_avatar( ...


2

You don't need a form to submit a comment to the wp-comments-post.php file, or to send a pingback or trackback. Spammers don't use forms, they simply send their spam directly. Removing the form doesn't "turn off" comments. To do that, go to the Posts screen, and use the Quick Edit to actually disable comments and trackbacks for the various posts. Also visit ...


2

you can use WP_Query <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; $args = array( 'post_type' => 'letters', 'posts_per_page' => 10, 'paged' => $paged, 'meta_key' => 'letter_show_on_site', 'meta_value' => "yes" ); $the_query = new WP_Query($args); if( $the_query->have_posts()){ ...


2

You are using comments_template which prints out the comments and returns nothing you need to capture the comments template so try this: function get_comments_template(){ ob_start(); comments_template(); return ob_get_clean(); } and change this line: $result .= comments_template(); //Append the comments template to the result to $result ...


2

wp_list_comments() accepts a walker in the array of its first parameter. This is a class that renders the output. If you don’t provide one, the default class will be used, Walker_Comment. You can find it in wp-includes/comment-template.php. To change the complete comment list out, create a custom walker in your functions.php which extends the default class: ...


2

You can try the gettext filter. According to the Codex: This filter hook is applied to the translated text by the internationalization functions (__(), _e(), _x(), etc.). This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. Here's an example: function custom_gettext( ...


2

The plugin you mentioned is only a single function so it shouldn't be too heavy on your setup. It uses the comments_template filter to inject the pingbacks/trackbacks list into your page. But the plugin is using an extra manual SQL query and the template is constructed by hand, so there's a room for improvements/simplifications. A simple demo plugin with ...


2

You can try to replace if ($current_user->ID == $post_data->post_author) { with if ( $current_user->ID == $post_data->post_author || $current_user->has_cap( 'manage_options' ) ) { to additionally allow users, with the correct capability, to vote for the best comment.


2

This can be done, there is even a possibility to control this via the backend, just go to: → Settings → Discussion And there under: → Other comment settings You have the point: → Enable threaded (nested) comments | X | levels deep


2

So after some time I done exactly what I wanted and I thought it would be nice to share. So in functions.php add function c_parent_comment_counter($pid,$uid){ global $wpdb; $query = "SELECT COUNT(comment_post_id) AS count FROM $wpdb->comments WHERE <code>comment_approved</code> = 1 AND <code>comment_post_ID</code> = $pid ...


2

There is definitely a performance advantage in keeping your comment spam to a minimum. If you have a lot of comments, the query time can get pretty out of control. To make it easier, you should install Akismet if you haven't already. Akismet will automatically detect spam comments and move them to WordPress spam section. You can then delete all the spam ...


1

Have you tried comment_post action? It's fired right after the comment is inserted into the database. function share_comment_on_facebook( $comment_ID ) { $commentdata = get_comment( $comment_ID ); if ( $commentdata['comment_approved'] ) { // fire up the code to launch pop up } } add_action( 'comment_post', 'share_comment_on_facebook' ); ...


1

WordPress runs a service to generate screenshots. You can get any website screenshot like this. http://s.wordpress.com/mshots/v1/http://www.google.com?w=400&h=300 And yes, it records as a hit on website and will be logged.


1

You'd probably have to do this in javascript, but I'm guessing the reason you want to add a class is to style it differently? If so, just use different styles for #respond that is inside a reply container. So perhaps the style would be .comment-replies > #respond or something similar.


1

Try this: http://wordpress.org/plugins/wp-ajaxify-comments/ or (manually) Add the following lines of code to your theme’s functions.php file add_action('init', 'wdp_ajaxcomments_load_js', 10); function wdp_ajaxcomments_load_js(){ wp_enqueue_script('ajaxValidate', ...


1

Livefyre Sidenotes plugin for WordPress does exactly this: https://wordpress.org/plugins/livefyre-sidenotes/ It enables contextual inline commenting not only per paragraph, but, within this, commenting on a particular section highlighted by the user, which would be closer to the MS Word implementation: Start by highlighting the text: When the ...


1

This will display them before the DISQUS comment form but not the count add_filter( 'comments_template', function( $pings_before_dsq_comments) { if( !function_exists( 'dsq_is_installed' ) || !dsq_is_installed() ) return $pings_before_dsq_comments; wp_list_comments( array( 'style' => 'ul', 'type' => 'pings' )); ...


1

A more brute simple hack method is to use jQuery to find target string Comment and replace it with Review. To do this you can check out this thread: http://stackoverflow.com/questions/8146648/jquery-find-text-and-replace Example: $("#container p:contains('Comment')").text("Review"); To include this script in your WordPress headers you can add an action ...



Only top voted, non community-wiki answers of a minimum length are eligible