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