內容簡介
顯示分享按鈕和追蹤按鈕。
按鈕
Twitter
Facebook
Instagram
Youtube
WordPress
Github
Line
Pocket
Hatena
RSS
Feedly
顯示
分享按鈕會在內容區塊之後立即顯示。
追蹤按鈕預設顯示在右上角,可以在設定頁面中更改。
追蹤按鈕也可以透過簡短代碼顯示。
分享按鈕過濾器
每個初始值都表示距離左側的位置。
如果值為 null,則會隱藏它。
ssfb_share_twitter:初始值為 1
ssfb_share_facebook:初始值為 2
ssfb_share_pocket:初始值為3
ssfb_share_hatena:初始值為4
ssfb_share_line:初始值為5
/** ==================================================
* 隱藏 Twitter 的過濾器。
*
*/
add_filter('ssfb_share_twitter', 函式() {返回 null;},10,1);
/** ==================================================
* 將 Twitter 和 Facebook 定位過濾器。
*
*/
add_filter( 'ssfb_share_twitter', 函式() {返回2;},10,1);
add_filter( 'ssfb_share_facebook', 函式() {返回1;},10,1);
如果要隱藏它,請將其設置為 false。
ssfb_share:初始值為 true
/** ==================================================
* 隱藏所有的過濾器。
*
*/
add_filter('ssfb_share', 函式() {返回 false;},10,1);
如果要透過文章 ID 隱藏它,請將其設置為 false。
ssfb_share_id:初始值為 true
/** ==================================================
* 顯示或不顯示帖子 ID 的簡單分享追蹤按鈕
*
* @param bool $flag 顯示。
* @param int $pid 帖子 ID。
* @since 1.00
*/
函式 ssfb_share_post_id( $flag, $pid ) {
if ( 1567 === $pid ) {
$flag = false;
}
return $flag;
}
add_filter( 'ssfb_share_id', 'ssfb_share_post_id', 10, 2 );
如果要透過文章類型隱藏它,請將其設置為 false。
ssfb_share_type:初始值為 true
/** ==================================================
* 顯示或不顯示帖子類型的簡單分享追蹤按鈕
*
* @param bool $flag 顯示。
* @param string $type 帖子類型。
* @since 1.00
*/
函式 ssfb_share_post_type( $flag, $type ) {
if ( 'page' === $type || 'attachment' === $type ) {
$flag = false;
}
return $flag;
}
add_filter( 'ssfb_share_type', 'ssfb_share_post_type', 10, 2 );
圖示
[IcoMoon – 免費 https://icomoon.io/]
許可證 GPL / CC BY 4.0
外掛標籤
開發者團隊
原文外掛簡介
Displays the Share button and Follow button.
Button
X(Twitter)
Facebook
Instagram
Youtube
WordPress
Github
Line
Pocket
Hatena
Rss
Feedly
View
The share button is displayed immediately after the content.
The follow button is displayed on the top right by default. It can be changed in the settings page.
The follow button can also be displayed with a shortcode.
Filter for share button
Each initial value indicates the position from the left side.
If the value is null, it will be hidden.
ssfb_share_twitter : initial value 1
ssfb_share_facebook : initial value 2
ssfb_share_pocket : initial value 3
ssfb_share_hatena : initial value 4
ssfb_share_line : initial value 5
/** ==================================================
* Filter for hide X(twitter).
*
*/
add_filter( 'ssfb_share_twitter', function(){ return null; }, 10, 1 );
/** ==================================================
* Filter for position X(twitter) and facebook.
*
*/
add_filter( 'ssfb_share_twitter', function(){ return 2; }, 10, 1 );
add_filter( 'ssfb_share_facebook', function(){ return 1; }, 10, 1 );
If you want to hide it, set it to false.
ssfb_share : initial value true
/** ==================================================
* Filter for hide all.
*
*/
add_filter( 'ssfb_share', function(){ return false; }, 10, 1 );
If you want to hide it by post ID, set it to false.
ssfb_share_id : initial value true
/** ==================================================
* Display by post ID or not for Simple Share Follow Button
*
* @param bool $flag view.
* @param int $pid post ID.
* @since 1.00
*/
function ssfb_share_post_id( $flag, $pid ) {
if ( 1567 === $pid ) {
$flag = false;
}
return $flag;
}
add_filter( 'ssfb_share_id', 'ssfb_share_post_id', 10, 2 );
If you want to hide it by post type, set it to false.
ssfb_share_type : initial value true
/** ==================================================
* Display by post type or not for Simple Share Follow Button
*
* @param bool $flag view.
* @param string $type post type.
* @since 1.00
*/
function ssfb_share_post_type( $flag, $type ) {
if ( 'page' === $type || 'attachment' === $type ) {
$flag = false;
}
return $flag;
}
add_filter( 'ssfb_share_type', 'ssfb_share_post_type', 10, 2 );
icon
[IcoMoon – Free https://icomoon.io/]
License GPL / CC BY 4.0
