PageRenderTime 26ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/litmus-core/kc-shortcodes/addons/our-team.php

https://bitbucket.org/Pandababe/boho
PHP | 140 lines | 134 code | 5 blank | 1 comment | 9 complexity | 3a4a3e7b63450c5479b090813a596e44 MD5 | raw file
Possible License(s): GPL-3.0
  1. <?php
  2. add_shortcode( 'sh_lm_our_team', function($atts, $content = null) {
  3. extract(shortcode_atts(array(
  4. 'title' => '',
  5. 'our_team' => '',
  6. ), $atts));
  7. ob_start(); ?>
  8. <section class="our-team">
  9. <div class="litmus-container">
  10. <div class="row">
  11. <div class="col-md-12">
  12. <h2 class="section-title"><?php echo esc_html($title); ?></h2>
  13. </div><!-- /.col-md-12 -->
  14. </div><!-- /.row -->
  15. <div class="row">
  16. <div class="col-12">
  17. <div class="team-slider owl-carousel">
  18. <?php
  19. if(!empty($our_team)) {
  20. foreach ($our_team as $team) {
  21. ?>
  22. <?php if(isset($team->name)) { ?>
  23. <div class="item">
  24. <div class="team-item">
  25. <div class="hexagonal">
  26. <div class="hexagonal-img-container">
  27. <div class="hexagonal-img-hex">
  28. <div class="hexagonal-img-hex1 hexagonal-img-hex2">
  29. <div class="hexagonal-img-hex-in1">
  30. <div class="hexagonal-img-hex-in2">
  31. <img src="<?php echo esc_url(sh_lm_get_image_crop_size($team->img, 250, 230)); ?>" class="hexagonal-image" alt="<?php esc_attr_e('team iamge', 'litmus'); ?>">
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div><!-- /.hexagonal -->
  38. <div class="team-content text-center">
  39. <h2 class="member-name"><?php if(isset($team->name)) echo esc_html($team->name); ?></h2>
  40. <p class="member-deseg"><?php if(isset($team->pos)) echo esc_html($team->pos); ?></p>
  41. <p class="member-description"><?php if(isset($team->desc)) echo esc_html($team->desc); ?></p>
  42. <div class="content-socials">
  43. <?php if($team->fblink) {?>
  44. <a href="<?php echo esc_url($team->fblink); ?>" target="_blank"><i class="fa-facebook"></i></a>
  45. <?php } ?>
  46. <?php if($team->twlink) {?>
  47. <a href="<?php echo esc_url($team->twlink); ?>" target="_blank"><i class="fa-twitter"></i></a>
  48. <?php } ?>
  49. <?php if($team->gpluslink) {?>
  50. <a href="<?php echo esc_url($team->gpluslink); ?>" target="_blank"><i class="fa-google-plus"></i></a>
  51. <?php } ?>
  52. </div>
  53. </div><!-- /.team-content -->
  54. </div><!-- /.team-item -->
  55. </div><!-- /.item -->
  56. <?php } ?>
  57. <?php } } ?>
  58. </div><!-- /.team-slider -->
  59. </div><!-- /.col-12 -->
  60. </div><!-- /.row -->
  61. </div><!-- /.container -->
  62. </section><!-- /.our-team -->
  63. <?php return ob_get_clean();
  64. });
  65. // Visual Composer Custom Shortcode
  66. add_action( 'init', 'sh_lm_kc_our_team', 99 );
  67. function sh_lm_kc_our_team() {
  68. if (function_exists('kc_add_map')) {
  69. kc_add_map(
  70. array(
  71. 'sh_lm_our_team' => array(
  72. 'name' => esc_html__('Our Team', 'litmus'),
  73. 'description' => esc_html__('Our Team', 'litmus'),
  74. 'icon' => 'et-profile-male',
  75. 'category' => 'Litmus',
  76. 'params' => array(
  77. 'general' => array(
  78. array(
  79. 'name' => 'title',
  80. 'type' => 'text',
  81. 'label' => esc_html__('Title', 'litmus'),
  82. 'value' => 'Our Team',
  83. 'admin_label' => true,
  84. ),
  85. array(
  86. 'name' => 'our_team',
  87. 'type' => 'group',
  88. 'label' => esc_html__('Our Team', 'litmus'),
  89. 'options' => array('add_text' => esc_html__('Add new member', 'litmus')),
  90. 'params' => array(
  91. array(
  92. 'name' => 'img',
  93. 'label' => esc_html__('Image', 'litmus'),
  94. 'type' => 'attach_image',
  95. ),
  96. array(
  97. 'name' => 'name',
  98. 'type' => 'text',
  99. 'label' => esc_html__('Name', 'litmus'),
  100. 'admin_label' => true,
  101. ),
  102. array(
  103. 'name' => 'pos',
  104. 'type' => 'text',
  105. 'label' => esc_html__('Position', 'litmus'),
  106. ),
  107. array(
  108. 'name' => 'desc',
  109. 'type' => 'textarea',
  110. 'label' => esc_html__('Description', 'litmus'),
  111. ),
  112. array(
  113. 'name' => 'fblink',
  114. 'type' => 'text',
  115. 'label' => esc_html__('Facebook Link', 'litmus'),
  116. ),
  117. array(
  118. 'name' => 'twlink',
  119. 'type' => 'text',
  120. 'label' => esc_html__('Twitter Link', 'litmus'),
  121. ),
  122. array(
  123. 'name' => 'gpluslink',
  124. 'type' => 'text',
  125. 'label' => esc_html__('Google Plus Link', 'litmus'),
  126. ),
  127. )
  128. ),
  129. ),
  130. )
  131. ), // End of elemnt kc_icon
  132. )
  133. ); // End add map
  134. } // End if
  135. }