WordPress.org

Support

Support » Requests and Feedback » comments_popup_link() should jive better with plugins

comments_popup_link() should jive better with plugins

  • comments_popup_link() does this:

    $comment_count_cache[$id] = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");

    it should probably use get_comments_number() instead. this would fix a bit of code duplication and make it more accessible to plugins since get_comments_number has plugin hooks.

    also, here


    if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
    echo $none;
    return;
    }

    comments_popup_link() short-circuits, and doesn’t use a filter, so this case can’t be touched by a plugin.

    i managed to work around these limitations, but it would be nice to have them in the core.

    many thanks!

  • The topic ‘comments_popup_link() should jive better with plugins’ is closed to new replies.
Skip to toolbar