Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Like Block: ensure that it can be displayed on CPTs too #38227

Closed foleynotrose closed 1 month ago

foleynotrose commented 3 months ago

Impacted plugin

Jetpack

What

Enable Likes on Custom Post Types

How

In ticket 8327637-zd-a8c, user requests that Likes be available for Custom Post Types.

github-actions[bot] commented 3 months ago

Support References

This comment is automatically generated. Please do not edit it.

jeherve commented 2 months ago

Likes are already available on CPTs: https://github.com/Automattic/jetpack/issues/8074#issuecomment-340846339

Looking at the linked ticket, I believe the problem is more about how we manage the display of Likes on a site when you deactivate the Likes module and only rely on the newer Like block instead. That Like Block should work on CPTs too, but looking at their report, it may not work yet. We will need to test this.

coder-karen commented 1 month ago

With Custom Post Types, likes work for me if I add the Like Block, but don't if I enable the Like module. The older Settings > Sharing page in wp-admin doesn't appear to be available any more, so I don't see a way to enable this for CPTs. This seems to match the issue reported in the ticket. @jeherve have you got a test site that shows the legacy settings?


On reading the ticket, an issue was mentioned with templates Like placement as well, but I don't believe that is an issue.

jeherve commented 1 month ago

The older Settings > Sharing page in wp-admin doesn't appear to be available any more, so I don't see a way to enable this for CPTs.

You should be able to activate them in Calypso blue, at https://wordpress.com/marketing/sharing-buttons/yoursite.com

Using a classic theme like Twenty Eleven, classic likes (i.e. via the module) seem to work well. I indeed do not have the flexibility to control where exactly Likes are hooked into the_content, but that's expected on classic themes.

image

Using a block theme like Twenty Twenty Four, and disabling the module to use a Like block instead, I am also able to add the LIke block:

image

It seems to me like we can close this issue?

coder-karen commented 1 month ago

You should be able to activate them in Calypso blue, at https://wordpress.com/marketing/sharing-buttons/yoursite.com

Oh! I see that in the support docs too now, but I'll make an edit to make explicit mention of CPTs. Yes, in that case, it looks like we can close it out.