jetpack
jetpack copied to clipboard
Sharing block: ensure compatibility with global settings set in module
Ensure compatibility with sharing settings that may have been created via the old module.
Compatibility may mean separating the settings entirely so the new block is only managed via the block / site editor, but that needs to be made clear in settings UI.
This issue may be broken down into multiple issues if necessary.
Epic: https://github.com/Automattic/jetpack/issues/19694
While working on https://github.com/Automattic/jetpack/issues/34115 (hook new block buttons to Sharing_Service) we basically has copied the logic needed inside the block, having it entirely separated from the Sharing Service.
We would still need to see, what would be the less confusing way to go, either entirely replace current logic (including central buttons controls in calypso), or make these work together.
I suggest we hold off this task until we get some feedback from Call For Testing.
#35542 brings us in this direction, but doesn't have any UI yet. We'll need to work on one, that will set the jetpack_sharing_buttons_auto_add
option when toggled. It is necessary, since we do not want to add the block to all sites as soon as they activate the plugin.
I think the easiest way would be if we could add UI to wp.com side on https://wordpress.com/marketing/sharing-buttons/:site
. We probably could add a notice there (for sites with block based themes), that has a link to Sharing Buttons docs and a button, that will switch to new behavior. Underhood, it would toggle jetpack_sharing_buttons_auto_add
for the site and disable old Sharedaddy feature.
Following up https://github.com/Automattic/jetpack/pull/35542 we could read these settings (could we?) and fill with buttons and styles from old module. Also, on https://:site/wp-admin/admin.php?page=jetpack#/sharing
, we might add another toggle, that will do the same for sites, where the old module enabled. If for some reason we can't do these manipulation from wp.com side, we could probably redirect users to page=jetpack#/sharing
and utilize that switch.
In terms of tasks I imagine it something like:
- Follow up with https://github.com/Automattic/jetpack/pull/35542 to add buttons based on settings from old module if user has ones. It should also correctly handle
Official button
defaulting to classic view andMore
button which should be skipped at this time. - Follow up with https://github.com/Automattic/jetpack/pull/35542 and possibly adding new filters to be able to add a sharing buttons to other templates matching old feature settings (posts, pages, media, etc.).
- Modify
https://:site/wp-admin/admin.php?page=jetpack#/sharing
, adding a button/toggle that will automatically setjetpack_sharing_buttons_auto_add
to true and old module feature to false. - Modify
https://wordpress.com/marketing/sharing-buttons/:site
to either have a button that does everything automatically or navigates tohttps://:site/wp-admin/admin.php?page=jetpack#/sharing
cc @keoshi
we could add UI to wp.com side on https://wordpress.com/marketing/sharing-buttons/:site
If we do, we would definitely need to add the same UI to wp-admin/admin.php?page=jetpack#/sharing
. We should avoid adding more UI elements that would only be available in Calypso.
I created https://github.com/Automattic/wp-calypso/pull/88294 to start with some improvements, and we're also discussing other options in https://github.com/Automattic/dotcom-forge/issues/5915