automattic / jetpack-sharing-likes
Sharing buttons and Like buttons for your posts.
Package info
github.com/Automattic/jetpack-sharing-likes
Type:jetpack-library
pkg:composer/automattic/jetpack-sharing-likes
Requires
- php: >=7.4
- automattic/jetpack-connection: ^9.9.0
- automattic/jetpack-status: ^7.1.0
Requires (Dev)
- automattic/phpunit-select-config: ^1.0.11
- yoast/phpunit-polyfills: ^4.0.0
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-09 19:34:56 UTC
README
Sharing buttons and Like buttons for your posts.
Today the package ships the wp-admin Settings > Sharing screen, under
src/settings/, and the same settings over REST, under wpcom/v2/sharing-likes/,
for the React version of the screen. A host plugin sets both up with one call,
on every request rather than in an is_admin() branch, since REST requests are
not admin requests, and Calypso's sidebar is built in one:
\Automattic\Jetpack\Sharing_Likes\Initializer::init();
Neither depends on a module being active: the screen and every section on it exist whichever modules are on, on any site that is Simple, connected, or in offline mode.
It also ships the per-post Likes and Sharing switches the block editor shows, as
REST fields on every public post type. Initializer::init() leaves these out:
each belongs to the feature that reads it, so call it wherever that feature
loads (Likes or Comment Likes, and Sharing), outside any is_admin() branch:
\Automattic\Jetpack\Sharing_Likes\Post_Likes_Switch::init(); \Automattic\Jetpack\Sharing_Likes\Post_Sharing_Switch::init();
Calling either more than once is harmless.
React screen (preview)
Settings > Sharing has a React version, off by default. To try it:
add_filter( 'rsm_jetpack_ui_modernization_sharing_likes', '__return_true' );
Add it before admin_menu runs, for example from a plugin or mu-plugin: the filter is
read on admin_menu at priority 1, so adding it on admin_init silently does nothing.
Build it with pnpm run build (or jp build packages/sharing-likes).
How to install sharing-likes
Installation From Git Repo
Contribute
Get Help
Using this package in your WordPress plugin
If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Security
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
License
sharing-likes is licensed under GNU General Public License v2 (or later)