wp-digital/wp-block-social-share
Composer 安装命令:
composer require wp-digital/wp-block-social-share
包简介
Links to share current post to most used social such as Facebook, Twitter, Email, LinkedIn.
README 文档
README
Description
Links to share current post to most used social such as Facebook, Twitter, Email, LinkedIn.
Demo
Install
-
Preferable way is to use Composer:
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 git@github.com:wp-digital/wp-block-social-share.git
Activate Social Share Block with WP-CLI
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' => '<svg viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="false" focusable="false"><path d="M496 256c0 137-111 248-248 248-25.6 0-50.2-3.9-73.4-11.1 10.1-16.5 25.2-43.5 30.8-65 3-11.6 15.4-59 15.4-59 8.1 15.4 31.7 28.5 56.8 28.5 74.8 0 128.7-68.8 128.7-154.3 0-81.9-66.9-143.2-152.9-143.2-107 0-163.9 71.8-163.9 150.1 0 36.4 19.4 81.7 50.3 96.1 4.7 2.2 7.2 1.2 8.3-3.3.8-3.4 5-20.3 6.9-28.1.6-2.5.3-4.7-1.7-7.1-10.1-12.5-18.3-35.3-18.3-56.6 0-54.7 41.4-107.6 112-107.6 60.9 0 103.6 41.5 103.6 100.9 0 67.1-33.9 113.6-78 113.6-24.3 0-42.6-20.1-36.7-44.8 7-29.5 20.5-61.3 20.5-82.6 0-19-10.2-34.9-31.4-34.9-24.9 0-44.9 25.7-44.9 60.2 0 22 7.4 36.8 7.4 36.8s-24.5 103.8-29 123.2c-5 21.4-3 51.6-.9 71.2C65.4 450.9 0 361.1 0 256 0 119 111 8 248 8s248 111 248 248z" /></svg>',
];
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 );
wp-digital/wp-block-social-share 适用场景与选型建议
wp-digital/wp-block-social-share 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 73 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 06 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 wp-digital/wp-block-social-share 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wp-digital/wp-block-social-share 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 73
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2023-06-20