外掛說明
The Web Share API is a Promise-based, single method API. It accepts an object which must have at least one of the properties named text or url.
Once invoked it will bring up the native picker and allow you to share the data with the app chosen by the user.
安裝方式
- Download and unzip the plugin.
- Upload the
lh-web-sharedirectory to the/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
常見問題集
- Installation Instructions
-
- Download and unzip the plugin.
- Upload the
lh-web-sharedirectory to the/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- So I have installed this plugin, now what?
-
- By defauls this plugin just installs the javascript necessary to trigger the web share dialog, when an anchor with the class lh_web_share is clicked. You need to include the anchors to action this in your content or theme. E.G Click me
使用者評論
2019 年 3 月 3 日
Many thanks for this plugin, I use it for adding a share-button below the content of single posts by adding the following hook to the functions.php of my child theme:
function lhws_add_to_content( $content ) {
if( is_single() && ! empty( $GLOBALS['post'] ) ) {
if ( $GLOBALS['post']->ID == get_the_ID() ) {
$content .= '<div class="sharing"><a href="#" class="lh_web_share" rel="nofollow">Share</a></div>';
}
}
return $content;
}
add_filter('the_content', 'lhws_add_to_content');
The plugin forwards to facebook sharing by default if the browser doesn’t support the Web Sharing API yet.
參與者及開發者
變更記錄
1.00 December 23, 2017
* Initial version.
