Wrong gravatar showing up?

If you go to http://gravatar.com/d6b10d5767d1e29006c11e1a2c590f3c (omit the /avatar/ from path) you get http://gravatar.com/clojita which seems to be your gravatar account, correct? MD5 collision is unlikely (but maybe it’s time to buy a lottery ticket 🙂 Look at source fetches interesting detail — the comment in question has comment-author-clark class. So it’s not only the gravatar … Read more

What is comment_karma?

You get the comment_karma property because there is such a column in the comments table. It is meaningless and AFAIK was never used for anything except for maybe some random spam prevention plugin. It is there just for backward compatibility and because no one thinks that removing it will improve anything in a measurable way. … Read more

Comments to Custom Post Type

Please try: $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘thread’ ); $thread_posts = get_posts( $args ); // Get all posts of thread. foreach($thread_posts as $thread_post_object) { /*not sure really need to be working IDs only, but is simpler, plus made checking was getting right ones easier */ $thread_post_IDs[] = $thread_post_object->ID; } foreach ($thread_post_IDs as … Read more

Altering the pingback functionality

Actually, it turned out quite easy, as the post can be retrieved from the slug: // get the url of the reffering post $ping_slug = $comment->comment_author_url; // keep just the slug $ping_slug = trim(parse_url($ping_slug, PHP_URL_PATH), “https://wordpress.stackexchange.com/”); // get the post from the slug $ping_post = get_page_by_path($ping_slug, OBJECT, ‘post’); // find the post author data $ping_author … Read more

Add a custom class to awating comments

Here’s one way to add a custom .wpse-comment-awaiting-moderation comment class through the comment_class filter: add_filter( ‘comment_class’, ‘wpse_259326_comment_classes’, 10, 5 ); function wpse_259326_comment_classes ( $classes, $class, $comment_ID, $comment, $post_id ) { if( ‘unapproved’ === wp_get_comment_status( $comment ) && is_array( $classes ) ) $classes[] = ‘wpse-comment-awaiting-moderation’; return $classes; } where we used that wp_get_comment_status( $comment ) returns … Read more

Why is Woocommerce writing in my wp_comment table?

Oh, that is double offtopic, but for the sake of helping other people which might wonder the same about EDD and maybe other plugins, the reason is because wordpress core to not have any easy support for hierarchy between CPTs except for comments being under posts. As orders are “belonging” to specific products it makes … Read more

Number of External Links in Comments – Moderation Option

Haha, I actually figured out a way to do this. As a plugin, this should work. class JPB_CommentCounter { var $count = 0; function __construct(){ add_filter( ‘pre_comment_content’, array( $this, ‘content’ ), 100 ); add_filter( ‘comment_max_links_url’, array( $this, ‘counter’ ) ); } function JPB_CommentCounter(){ $this->__construct(); } function counter( $num, $url ){ if($this->count < 1) return $num; … Read more

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