Sharing: Function Reference
You can use pipit_sharing_link()
to generate/output the link in PHP.
Parameters:
pipit_sharing_link($type, $opts, $return);
Type | Description |
---|---|
String | Link type |
Array | Options array, see below |
Boolean | Set to true to have the value returned instead of echoed. |
The array options can include link specific options. Additionally it can include these options:
Option | Value |
---|---|
page-url | URL. Bu default Pipit Sharing uses the page’s URL. You can specify a different URL with this option. |
include-domain | To be used with page-url . If set to true , the website domain is included. |
Examples
Simple link with options
pipit_sharing_link('twitter', [
'desc' => 'Some text',
'tags' => 'PHP,CMS'
]);
Set your own URL
pipit_sharing_link('twitter', [
'page-url' => 'https://example.com',
]);
Using relative links:
pipit_sharing_link('twitter', [
'page-url' => '/contact',
'include-domain' => true,
]);
Calendar links
For calendar links you have to set the from
and to
options:
pipit_sharing_link('google_cal', [
'from' => '2019-04-01 09:00',
'to' => '2019-04-01 13:00',
]);