Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wp-digital/wp-block-social-share
Links to share current post to most used social such as Facebook, Twitter, Email, LinkedIn.
https://github.com/wp-digital/wp-block-social-share
block gutenberg-blocks social-share wordpress-plugin
Last synced: about 1 month ago
JSON representation
Links to share current post to most used social such as Facebook, Twitter, Email, LinkedIn.
- Host: GitHub
- URL: https://github.com/wp-digital/wp-block-social-share
- Owner: wp-digital
- Created: 2021-11-26T10:30:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T11:54:48.000Z (over 1 year ago)
- Last Synced: 2024-11-15T19:39:24.096Z (about 2 months ago)
- Topics: block, gutenberg-blocks, social-share, wordpress-plugin
- Language: PHP
- Homepage: https://demo.wpd.digital/social-share-block/
- Size: 1.62 MB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Social Share Block
### Description
Links to share current post to most used social such as Facebook, Twitter, Email, LinkedIn.
### Demo
[Social Share Block](https://demo.wpd.digital/social-share-block/)
### Install
- Preferable way is to use [Composer](https://getcomposer.org/):
````
composer require wp-digital/wp-block-social-share
````- Alternate way is to clone this repo to `wp-content/plugins/`:
````
cd wp-content/plugins/
git clone [email protected]:wp-digital/wp-block-social-share.git
````Activate **Social Share Block** with [WP-CLI](https://make.wordpress.org/cli/handbook/)
`wp plugin activate wp-block-social-share` or from **Plugins** page.### Documentation
Add, change or remove social with hook `wpd-block-social-share-socials`. If new social
added then its URL needs to be implemented via `wpd-block-social-share-$social-url` filter. **Example**:````
add_filter( 'wpd-block-social-share-socials', function ( array $socials ) : array {
unset( $socials['linkedin'] );$socials['pinterest'] = [
'label' => esc_html__( 'Share on Pinterest', 'your-text-domain' ),
'icon' => '',
];return $socials;
} );
````````
add_filter( 'wpd-block-social-share-pinterest-url', function ( string $url, int $post_id ) : string {
return add_query_arg( [
'url' => get_the_permalink( $post_id ),
'description' => get_the_title( $post_id ),
], 'https://pinterest.com/pin/create/button/' );
}, 10, 2 );
````