| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
$mods = betterdocs()->customizer->defaults->generate_defaults(); |
| 8 |
|
| 9 |
if ( ! $mods['betterdocs_post_social_share'] ) { |
| 10 |
return; |
| 11 |
} |
| 12 |
|
| 13 |
$social_sharing_text = $mods['betterdocs_social_sharing_text']; |
| 14 |
$social_sharing_title_tag = $mods['betterdocs_social_share_title_tag']; |
| 15 |
$facebook_sharing = $mods['betterdocs_post_social_share_facebook']; |
| 16 |
$twitter_sharing = $mods['betterdocs_post_social_share_twitter']; |
| 17 |
$linkedin_sharing = $mods['betterdocs_post_social_share_linkedin']; |
| 18 |
$pinterest_sharing = $mods['betterdocs_post_social_share_pinterest']; |
| 19 |
|
| 20 |
$attributes = betterdocs()->template_helper->get_html_attributes( |
| 21 |
[ |
| 22 |
'layout' => 'layout-2', |
| 23 |
'title' => "{$social_sharing_text}", |
| 24 |
'title_tag' => "{$social_sharing_title_tag}", |
| 25 |
'facebook' => "{$facebook_sharing}", |
| 26 |
'twitter' => "{$twitter_sharing}", |
| 27 |
'linkedin' => "{$linkedin_sharing}", |
| 28 |
'pinterest' => "{$pinterest_sharing}" |
| 29 |
] |
| 30 |
); |
| 31 |
|
| 32 |
echo do_shortcode( '[betterdocs_social_share ' . $attributes . ']' ); |
| 33 |
|