| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPDeveloper\BetterDocs\Shortcodes; |
| 4 |
|
| 5 |
use WPDeveloper\BetterDocs\Core\Shortcode; |
| 6 |
use WPDeveloper\BetterDocs\Traits\SocialShare as SocialShareTrait; |
| 7 |
|
| 8 |
class SocialShare extends Shortcode { |
| 9 |
use SocialShareTrait; |
| 10 |
|
| 11 |
protected $deprecated_attributes = [ |
| 12 |
'facebook_sharing' => 'facebook', |
| 13 |
'pinterest_sharing' => 'pinterest', |
| 14 |
'twitter_sharing' => 'twitter', |
| 15 |
'linkedin_sharing' => 'linkedin' |
| 16 |
]; |
| 17 |
|
| 18 |
public function get_name() { |
| 19 |
return 'betterdocs_social_share'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_style_depends() { |
| 23 |
return [ 'betterdocs-social-share' ]; |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Summary of default_attributes |
| 28 |
* @return array |
| 29 |
*/ |
| 30 |
public function default_attributes() { |
| 31 |
return [ |
| 32 |
'layout' => 'layout-1', |
| 33 |
'title' => __( 'Share This Article :', 'betterdocs' ), |
| 34 |
'title_tag' => 'h5', |
| 35 |
'facebook' => '1', |
| 36 |
'twitter' => '1', |
| 37 |
'linkedin' => '1', |
| 38 |
'pinterest' => '1', |
| 39 |
'instagram' => '1', |
| 40 |
]; |
| 41 |
} |
| 42 |
|
| 43 |
public function render( $atts, $content = null ) { |
| 44 |
if ( isset( $atts['layout'] ) && $atts['layout'] == 'layout-2' ) { |
| 45 |
$this->views( 'widgets/social-2' ); |
| 46 |
} else { |
| 47 |
$this->views( 'widgets/social' ); |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|