Skip to content

Likes: display like count in post list table, when Likes module is enabled #38939

Open

Description

This is a follow-up to #19659.

Steps to reproduce

  1. Start with a site using a block-based theme like Twenty Twenty Four
  2. Activate the Jetpack plugin
  3. Connect your site to your WordPress.com account
  4. Go to Appearance > Editor
  5. Insert a Like block somewhere in your single posts template.
  6. You'll now be able to Like your posts.
  7. Go to Posts > All Posts
    • You will not see any indication that you've received Likes there.
  8. Now go to Jetpack > Settings > Sharing
  9. Enable the Likes module
  10. Go back to Posts > All Posts
    • You will now see the Likes count

Ideally, when the Like block is used somewhere in the active theme's templates, we should add the column to the post list table, vs. just doing it when the module is active:

add_filter( 'manage_posts_columns', array( $this, 'add_like_count_column' ) );
add_filter( 'manage_pages_columns', array( $this, 'add_like_count_column' ) );
add_action( 'manage_posts_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );
add_action( 'manage_pages_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Block] Like[Feature] Likes[Plugin] JetpackIssues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/[Pri] Normal[Type] EnhancementChanges to an existing feature — removing, adding, or changing parts of itChanges to an existing feature — removing, adding, or changing parts of it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions