Repo | Release | Link | Client | Features | Developer |
---|---|---|---|---|---|
repo | 16/12-24 | link | Norks Pensjon | copy linkfacebooklinkedinmailprintsharetwitter | Łukasz B. |
Functionality
Simple article share block, allow to select multiple share networks:
- CopyLink
And share text, which can be placed top, or left or light.
Content of the block can be aligned to left/right/center
Editor
Notes
The credits goes to author of the block for Mills (sorry idk who did it, you can just edit it 🙂 ).
But this blocks have extended options, allows to add text, does not relay on external styles or mixins or icons or scripts like Mills share block. So this block is easy to plug-in on the page. Just color varibles require to set up.
Additionally I re-write copy to use old input method to copy text instead of navigator clipboard since it does not work on every browser, works on only secured pages and require user to accept usage of clipboard so users may automatically click NO in popup that says “the page want to access your device” 🙂
Transition for hovers and notification for copy are animated.
The inner block aligment use align block component. But to get rid of original one I had too use hook – due to WP bug. This should not be an issue in WP 6+
In case the hook code:
/**
* WordPress dependencies
*/
import { addFilter } from '@wordpress/hooks';
addFilter(
'blocks.registerBlockType',
'np/block-share',
function (settings, blockName) {
if (blockName === 'np/social-share') {
return {
...settings,
supports: {
...settings.supports,
align: false, // disable the align-UI completely
},
};
}
return settings;
},
);