vc-facebook.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. /**
  6. * Class WPBakeryShortCode_Vc_Facebook
  7. */
  8. class WPBakeryShortCode_Vc_Facebook extends WPBakeryShortCode {
  9. /**
  10. * @param $atts
  11. * @param null $content
  12. * @return string
  13. * @throws \Exception
  14. */
  15. protected function contentInline( $atts, $content = null ) {
  16. /**
  17. * Shortcode attributes
  18. * @var $atts
  19. * @var $type
  20. * @var $el_class
  21. * @var $css
  22. * @var $css_animation
  23. * Shortcode class
  24. * @var WPBakeryShortCode_Vc_Facebook $this
  25. */
  26. $type = $css = $el_class = '';
  27. $atts = vc_map_get_attributes( $this->getShortcode(), $atts );
  28. extract( $atts );
  29. $url = get_permalink();
  30. $css = isset( $atts['css'] ) ? $atts['css'] : '';
  31. $el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
  32. $class_to_filter = 'wpb_googleplus vc_social-placeholder wpb_content_element vc_socialtype-' . $type;
  33. $class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
  34. $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
  35. return '<a href="' . esc_url( $url ) . '" class="' . esc_attr( $css_class ) . '"></a>';
  36. }
  37. }