Share Button
Share Button allows you to add a share button to your posts, making it easy for readers to share your content on social media.
Hooks and filters
Section titled “Hooks and filters”PHP filters
Section titled “PHP filters”mediapress_share_button_block_platforms
Section titled “mediapress_share_button_block_platforms”Configure the platforms used within the share block modal.
Default Value:
<?php[ 'facebook' => [ 'label' => 'Facebook', 'url' => 'https://www.facebook.com/sharer/sharer.php?u=%%URL%%', 'icon' => '', ], 'x' => [ 'label' => 'X', 'url' => 'https://x.com/intent/tweet?url=%%URL%%', 'icon' => '', ], 'linkedin' => [ 'label' => 'LinkedIn', 'url' => 'https://www.linkedin.com/sharing/share-offsite/?url=%%URL%%', 'icon' => '', ],]Example:
<?php
add_filter( 'mediapress_share_button_block_platforms', 'myexample_available_platforms' );
function myexample_available_platforms( $platforms ) { // remove linkedin unset( $platforms['linkedin'] );
$platforms['bluesky'] = [ 'icon' => '', 'label' => 'BSky', // Note: See %%URL%% to dictate where the url will be placed. 'url' => 'https://bsky.app/intent/compose?text=%%URL%%' ];
// this should be html like an svg/img tag $platforms['x']['icon'] = '<img src="https://place-hold.it/40" />';
return $platforms;}