| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
/*-----------------------------------------------------------------------------------*/ |
| 6 |
/* Team Member |
| 7 |
/*-----------------------------------------------------------------------------------*/ |
| 8 |
|
| 9 |
class WPBakeryShortCode_borderless_wpbakery_team_member extends WPBakeryShortCode { |
| 10 |
protected function content( $atts, $content = null ) { |
| 11 |
extract( shortcode_atts( array( |
| 12 |
'picture' => null, |
| 13 |
'picture_size' => null, |
| 14 |
'name' => null, |
| 15 |
'name_tag' => 'h3', |
| 16 |
'job_position' => null, |
| 17 |
'job_position_tag' => 'h4', |
| 18 |
'description' => null, |
| 19 |
'behance' => null, |
| 20 |
'dribbble' => null, |
| 21 |
'facebook' => null, |
| 22 |
'github' => null, |
| 23 |
'instagram' => null, |
| 24 |
'linkedin' => null, |
| 25 |
'medium' => null, |
| 26 |
'pinterest' => null, |
| 27 |
'reddit' => null, |
| 28 |
'snapchat' => null, |
| 29 |
'tiktok' => null, |
| 30 |
'twitch' => null, |
| 31 |
'twitter' => null, |
| 32 |
'vimeo' => null, |
| 33 |
'wechat' => null, |
| 34 |
'whatsapp' => null, |
| 35 |
'youtube' => null, |
| 36 |
'open_in_new_window' => null, |
| 37 |
'add_nofollow' => null, |
| 38 |
'color' => null, |
| 39 |
'custom_color' => null, |
| 40 |
//Static |
| 41 |
'el_id' => null, |
| 42 |
'el_class' => null, |
| 43 |
'css' => null, |
| 44 |
'css_animation' => '' |
| 45 |
), $atts ) ); |
| 46 |
$output = ''; |
| 47 |
|
| 48 |
|
| 49 |
// Retrieve data from the database. |
| 50 |
$options = get_option( 'borderless' ); |
| 51 |
|
| 52 |
|
| 53 |
// Set default values |
| 54 |
$borderless_primary_color = isset( $options['primary_color'] ) ? $options['primary_color'] : '#3379fc'; //Primary Color |
| 55 |
$borderless_secondary_color = isset( $options['secondary_color'] ) ? $options['secondary_color'] : '#3379fc'; //Secondary Color |
| 56 |
$borderless_text_color = isset( $options['text_color'] ) ? $options['text_color'] : ''; //Text Color |
| 57 |
$borderless_accent_color = isset( $options['accent_color'] ) ? $options['accent_color'] : '#3379fc'; //Accent Color |
| 58 |
|
| 59 |
// Picture |
| 60 |
$picture_url = isset($picture) ? wp_get_attachment_image_src( $picture, $picture_size) : ''; |
| 61 |
$picture = isset( $picture_url[0] ) ? $picture_url[0] : vc_asset_url( 'vc/no_image.png' ); |
| 62 |
|
| 63 |
// Target Blank |
| 64 |
$open_in_new_window = isset($open_in_new_window) ? 'target="_blank"' : ''; |
| 65 |
$add_nofollow = isset($add_nofollow) ? 'rel="nofollow"' : ''; |
| 66 |
|
| 67 |
// Color |
| 68 |
if ($color == 'primary_color') { |
| 69 |
$color = 'style="color:'.$borderless_primary_color.';"'; |
| 70 |
} else if ($color == 'secondary_color') { |
| 71 |
$color = 'style="color:'.$borderless_secondary_color.';"'; |
| 72 |
} else { |
| 73 |
$color = isset($custom_color) ? 'style="color:'.$custom_color.';"' : 'style="color:'.$borderless_primary_color.';"'; |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
// Default Extra Class, CSS and CSS animation |
| 78 |
$css = isset( $atts['css'] ) ? $atts['css'] : ''; |
| 79 |
$el_id = isset( $atts['el_id'] ) ? 'id="' . esc_attr( $el_id ) . '"' : ''; |
| 80 |
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : ''; |
| 81 |
if ( '' !== $css_animation ) { |
| 82 |
wp_enqueue_script( 'waypoints' ); |
| 83 |
$css_animation_style = ' wpb_animate_when_almost_visible wpb_' . $css_animation; |
| 84 |
} |
| 85 |
$class_to_filter = vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation ); |
| 86 |
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts ); |
| 87 |
|
| 88 |
// Output |
| 89 |
$output .= '<div '.$el_id.' class="borderless-wpbakery-team-member '.$css_class.'">'; |
| 90 |
$output .= '<img class="borderless-wpbakery-team-member-picture" src="'.$picture.'" >'; |
| 91 |
|
| 92 |
$output .= '<div class="borderless-wpbakery-team-content">'; |
| 93 |
|
| 94 |
$output .= isset($name) ? '<'.$name_tag.'>'.$name.'</'.$name_tag.'>' : ''; |
| 95 |
|
| 96 |
$output .= isset($job_position) ? '<'.$job_position_tag.'>'.$job_position.'</'.$job_position_tag.'>' : ''; |
| 97 |
|
| 98 |
$output .= '<ul class="borderless-wpbakery-team-member-social-profiles">'; |
| 99 |
|
| 100 |
$output .= isset($behance) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$behance.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Behance"><i class="vi vi-behance"></i></a></li>' : ''; |
| 101 |
|
| 102 |
$output .= isset($dribbble) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$dribbble.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Dribbble"><i class="vi vi-dribbble"></i></a></li>' : ''; |
| 103 |
|
| 104 |
$output .= isset($facebook) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$facebook.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Facebook"><i class="vi vi-facebook"></i></a></li>' : ''; |
| 105 |
|
| 106 |
$output .= isset($github) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$github.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Github"><i class="vi vi-github"></i></a></li>' : ''; |
| 107 |
|
| 108 |
$output .= isset($instagram) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$instagram.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Instagram"><i class="vi vi-instagram"></i></a></li>' : ''; |
| 109 |
|
| 110 |
$output .= isset($linkedin) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$linkedin.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Linkedin"><i class="vi vi-linkedin"></i></a></li>' : ''; |
| 111 |
|
| 112 |
$output .= isset($medium) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$medium.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Medium"><i class="vi vi-medium"></i></a></li>' : ''; |
| 113 |
|
| 114 |
$output .= isset($pinterest) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$pinterest.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Pinterest"><i class="vi vi-pinterest"></i></a></li>' : ''; |
| 115 |
|
| 116 |
$output .= isset($reddit) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$reddit.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Reddit"><i class="vi vi-reddit"></i></a></li>' : ''; |
| 117 |
|
| 118 |
$output .= isset($snapchat) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$snapchat.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Snapchat"><i class="vi vi-snapchat"></i></a></li>' : ''; |
| 119 |
|
| 120 |
$output .= isset($tiktok) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$tiktok.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Tiktok"><i class="vi vi-tiktok"></i></a></li>' : ''; |
| 121 |
|
| 122 |
$output .= isset($twitch) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$twitch.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Twitch"><i class="vi vi-twitch"></i></a></li>' : ''; |
| 123 |
|
| 124 |
$output .= isset($twitter) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$twitter.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Twitter"><i class="vi vi-twitter"></i></a></li>' : ''; |
| 125 |
|
| 126 |
$output .= isset($vimeo) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$vimeo.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Vimeo"><i class="vi vi-vimeo"></i></a></li>' : ''; |
| 127 |
|
| 128 |
$output .= isset($wechat) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$wechat.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Wechat"><i class="vi vi-wechat"></i></a></li>' : ''; |
| 129 |
|
| 130 |
$output .= isset($whatsapp) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$whatsapp.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Whatsapp"><i class="vi vi-whatsapp"></i></a></li>' : ''; |
| 131 |
|
| 132 |
$output .= isset($youtube) ? '<li class="borderless-wpbakery-team-member-social-profile"><a href="'.$youtube.'" '.$open_in_new_window.' '.$add_nofollow.' '.$color.' title="Youtube"><i class="vi vi-youtube"></i></a></li>' : ''; |
| 133 |
|
| 134 |
$output .= '</ul>'; |
| 135 |
|
| 136 |
$output .= isset($description) ? '<p>'.$description.'</p>' : ''; |
| 137 |
|
| 138 |
$output .= '</div>'; |
| 139 |
|
| 140 |
$output .= '</div>'; |
| 141 |
|
| 142 |
return $output; |
| 143 |
} |
| 144 |
} |
| 145 |
|
| 146 |
return array( |
| 147 |
'name' => __( 'Team Member', 'borderless' ), |
| 148 |
'base' => 'borderless_wpbakery_team_member', |
| 149 |
'icon' => plugins_url('../images/team-member.png', __FILE__), |
| 150 |
'show_settings_on_create' => true, |
| 151 |
'category' => __( 'Borderless', 'borderless' ), |
| 152 |
'description' => __( 'Create a stylish team member with the impressive options', 'borderless' ), |
| 153 |
'params' => array( |
| 154 |
|
| 155 |
array( |
| 156 |
'type' => 'attach_image', |
| 157 |
'heading' => __( 'Picture', 'borderless' ), |
| 158 |
'param_name' => 'picture', |
| 159 |
'description' => __( 'Upload team member picture.', 'borderless' ), |
| 160 |
), |
| 161 |
|
| 162 |
array( |
| 163 |
'type' => 'textfield', |
| 164 |
'heading' => __( 'Picture Size', 'borderless' ), |
| 165 |
'param_name' => 'picture_size', |
| 166 |
'description' => __( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'borderless' ), |
| 167 |
), |
| 168 |
|
| 169 |
|
| 170 |
/*-----------------------------------------------------------------------------------*/ |
| 171 |
/* Content |
| 172 |
/*-----------------------------------------------------------------------------------*/ |
| 173 |
|
| 174 |
array( |
| 175 |
'type' => 'textfield', |
| 176 |
'heading' => __( 'Name', 'borderless' ), |
| 177 |
'param_name' => 'name', |
| 178 |
'group' => 'Content', |
| 179 |
'edit_field_class' => 'vc_col-sm-8', |
| 180 |
), |
| 181 |
|
| 182 |
array( |
| 183 |
'type' => 'dropdown', |
| 184 |
'class' => '', |
| 185 |
'heading' => __( 'Tag', 'borderless' ), |
| 186 |
'param_name' => 'name_tag', |
| 187 |
'value' => array( |
| 188 |
__( 'Default', 'borderless' ) => 'h3', |
| 189 |
__( 'H1', 'borderless' ) => 'h1', |
| 190 |
__( 'H2', 'borderless' ) => 'h2', |
| 191 |
__( 'H4', 'borderless' ) => 'h4', |
| 192 |
__( 'H5', 'borderless' ) => 'h5', |
| 193 |
__( 'H6', 'borderless' ) => 'h6', |
| 194 |
__( 'Div', 'borderless' ) => 'div', |
| 195 |
__( 'p', 'borderless' ) => 'p', |
| 196 |
__( 'span', 'borderless' ) => 'span', |
| 197 |
), |
| 198 |
'description' => __( 'Default is H3', 'borderless' ), |
| 199 |
'group' => 'Content', |
| 200 |
'edit_field_class' => 'vc_col-sm-4 borderless-wpbakery-remove-padding', |
| 201 |
), |
| 202 |
|
| 203 |
array( |
| 204 |
'type' => 'textfield', |
| 205 |
'heading' => __( 'Job Position', 'borderless' ), |
| 206 |
'param_name' => 'job_position', |
| 207 |
'group' => 'Content', |
| 208 |
'edit_field_class' => 'vc_col-sm-8', |
| 209 |
), |
| 210 |
|
| 211 |
array( |
| 212 |
'type' => 'dropdown', |
| 213 |
'class' => '', |
| 214 |
'heading' => __( 'Tag', 'borderless' ), |
| 215 |
'param_name' => 'job_position_tag', |
| 216 |
'value' => array( |
| 217 |
__( 'Default', 'borderless' ) => 'h4', |
| 218 |
__( 'H1', 'borderless' ) => 'h1', |
| 219 |
__( 'H2', 'borderless' ) => 'h2', |
| 220 |
__( 'H3', 'borderless' ) => 'h3', |
| 221 |
__( 'H5', 'borderless' ) => 'h5', |
| 222 |
__( 'H6', 'borderless' ) => 'h6', |
| 223 |
__( 'Div', 'borderless' ) => 'div', |
| 224 |
__( 'p', 'borderless' ) => 'p', |
| 225 |
__( 'span', 'borderless' ) => 'span', |
| 226 |
), |
| 227 |
'description' => __( 'Default is H4', 'borderless' ), |
| 228 |
'group' => 'Content', |
| 229 |
'edit_field_class' => 'vc_col-sm-4', |
| 230 |
), |
| 231 |
|
| 232 |
array( |
| 233 |
'type' => 'textarea', |
| 234 |
'heading' => __( 'Description', 'borderless' ), |
| 235 |
'holder' => 'div', |
| 236 |
'param_name' => 'description', |
| 237 |
'group' => 'Content', |
| 238 |
), |
| 239 |
|
| 240 |
|
| 241 |
/*-----------------------------------------------------------------------------------*/ |
| 242 |
/* Social Profiles |
| 243 |
/*-----------------------------------------------------------------------------------*/ |
| 244 |
|
| 245 |
array( |
| 246 |
'type' => 'textfield', |
| 247 |
'heading' => __( 'Behance', 'borderless' ), |
| 248 |
'param_name' => 'behance', |
| 249 |
'group' => 'Social Profiles', |
| 250 |
), |
| 251 |
|
| 252 |
array( |
| 253 |
'type' => 'textfield', |
| 254 |
'heading' => __( 'Dribbble', 'borderless' ), |
| 255 |
'param_name' => 'dribbble', |
| 256 |
'group' => 'Social Profiles', |
| 257 |
), |
| 258 |
|
| 259 |
array( |
| 260 |
'type' => 'textfield', |
| 261 |
'heading' => __( 'Facebook', 'borderless' ), |
| 262 |
'param_name' => 'facebook', |
| 263 |
'group' => 'Social Profiles', |
| 264 |
), |
| 265 |
|
| 266 |
array( |
| 267 |
'type' => 'textfield', |
| 268 |
'heading' => __( 'Github', 'borderless' ), |
| 269 |
'param_name' => 'github', |
| 270 |
'group' => 'Social Profiles', |
| 271 |
), |
| 272 |
|
| 273 |
array( |
| 274 |
'type' => 'textfield', |
| 275 |
'heading' => __( 'Instagram', 'borderless' ), |
| 276 |
'param_name' => 'instagram', |
| 277 |
'group' => 'Social Profiles', |
| 278 |
), |
| 279 |
|
| 280 |
array( |
| 281 |
'type' => 'textfield', |
| 282 |
'heading' => __( 'Linkedin', 'borderless' ), |
| 283 |
'param_name' => 'linkedin', |
| 284 |
'group' => 'Social Profiles', |
| 285 |
), |
| 286 |
|
| 287 |
array( |
| 288 |
'type' => 'textfield', |
| 289 |
'heading' => __( 'Medium', 'borderless' ), |
| 290 |
'param_name' => 'medium', |
| 291 |
'group' => 'Social Profiles', |
| 292 |
), |
| 293 |
|
| 294 |
array( |
| 295 |
'type' => 'textfield', |
| 296 |
'heading' => __( 'Pinterest', 'borderless' ), |
| 297 |
'param_name' => 'pinterest', |
| 298 |
'group' => 'Social Profiles', |
| 299 |
), |
| 300 |
|
| 301 |
array( |
| 302 |
'type' => 'textfield', |
| 303 |
'heading' => __( 'Reddit', 'borderless' ), |
| 304 |
'param_name' => 'reddit', |
| 305 |
'group' => 'Social Profiles', |
| 306 |
), |
| 307 |
|
| 308 |
array( |
| 309 |
'type' => 'textfield', |
| 310 |
'heading' => __( 'Snapchat', 'borderless' ), |
| 311 |
'param_name' => 'snapchat', |
| 312 |
'group' => 'Social Profiles', |
| 313 |
), |
| 314 |
|
| 315 |
array( |
| 316 |
'type' => 'textfield', |
| 317 |
'heading' => __( 'TikTok', 'borderless' ), |
| 318 |
'param_name' => 'tiktok', |
| 319 |
'group' => 'Social Profiles', |
| 320 |
), |
| 321 |
|
| 322 |
array( |
| 323 |
'type' => 'textfield', |
| 324 |
'heading' => __( 'Twitch', 'borderless' ), |
| 325 |
'param_name' => 'twitch', |
| 326 |
'group' => 'Social Profiles', |
| 327 |
), |
| 328 |
|
| 329 |
array( |
| 330 |
'type' => 'textfield', |
| 331 |
'heading' => __( 'Twitter', 'borderless' ), |
| 332 |
'param_name' => 'twitter', |
| 333 |
'group' => 'Social Profiles', |
| 334 |
), |
| 335 |
|
| 336 |
array( |
| 337 |
'type' => 'textfield', |
| 338 |
'heading' => __( 'Vimeo', 'borderless' ), |
| 339 |
'param_name' => 'vimeo', |
| 340 |
'group' => 'Social Profiles', |
| 341 |
), |
| 342 |
|
| 343 |
array( |
| 344 |
'type' => 'textfield', |
| 345 |
'heading' => __( 'WeChat', 'borderless' ), |
| 346 |
'param_name' => 'wechat', |
| 347 |
'group' => 'Social Profiles', |
| 348 |
), |
| 349 |
|
| 350 |
array( |
| 351 |
'type' => 'textfield', |
| 352 |
'heading' => __( 'WhatsApp', 'borderless' ), |
| 353 |
'param_name' => 'whatsapp', |
| 354 |
'group' => 'Social Profiles', |
| 355 |
), |
| 356 |
|
| 357 |
array( |
| 358 |
'type' => 'textfield', |
| 359 |
'heading' => __( 'Youtube', 'borderless' ), |
| 360 |
'param_name' => 'youtube', |
| 361 |
'group' => 'Social Profiles', |
| 362 |
), |
| 363 |
|
| 364 |
array( |
| 365 |
'type' => 'checkbox', |
| 366 |
'heading' => __( 'Open in new window', 'borderless' ), |
| 367 |
'param_name' => 'open_in_new_window', |
| 368 |
'value' => __( '', 'borderless' ), |
| 369 |
'group' => 'Social Profiles', |
| 370 |
), |
| 371 |
|
| 372 |
array( |
| 373 |
'type' => 'checkbox', |
| 374 |
'heading' => __( 'Add nofollow', 'borderless' ), |
| 375 |
'param_name' => 'add_nofollow', |
| 376 |
'value' => __( '', 'borderless' ), |
| 377 |
'group' => 'Social Profiles', |
| 378 |
), |
| 379 |
|
| 380 |
|
| 381 |
/*-----------------------------------------------------------------------------------*/ |
| 382 |
/* Style |
| 383 |
/*-----------------------------------------------------------------------------------*/ |
| 384 |
|
| 385 |
array( |
| 386 |
'type' => 'dropdown', |
| 387 |
'class' => '', |
| 388 |
'heading' => __( 'Color', 'borderless' ), |
| 389 |
'param_name' => 'color', |
| 390 |
'value' => array( |
| 391 |
__( 'Primary Color', 'borderless' ) => 'primary_color', |
| 392 |
__( 'Secondary Color', 'borderless' ) => 'secondary_color', |
| 393 |
__( 'Custom Color', 'borderless' ) => 'custom_color', |
| 394 |
), |
| 395 |
'description' => __( 'Default is Primary Color', 'borderless' ), |
| 396 |
'group' => 'Style', |
| 397 |
), |
| 398 |
|
| 399 |
array( |
| 400 |
'type' => 'colorpicker', |
| 401 |
'heading' => __( 'Custom Color', 'borderless' ), |
| 402 |
'param_name' => 'custom_color', |
| 403 |
'description' => __( 'Select custom color.', 'borderless' ), |
| 404 |
'group' => 'Style', |
| 405 |
'dependency' => array( |
| 406 |
'element' => 'color', |
| 407 |
'value' => array( 'custom_color' ), |
| 408 |
), |
| 409 |
), |
| 410 |
|
| 411 |
// Animation |
| 412 |
vc_map_add_css_animation(), |
| 413 |
|
| 414 |
array( |
| 415 |
'type' => 'el_id', |
| 416 |
'heading' => __( 'Element ID', 'borderless' ), |
| 417 |
'param_name' => 'el_id', |
| 418 |
'description' => sprintf( __( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'borderless' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ), |
| 419 |
), |
| 420 |
|
| 421 |
array( |
| 422 |
'type' => 'textfield', |
| 423 |
'heading' => __( 'Extra class name', 'borderless' ), |
| 424 |
'param_name' => 'el_class', |
| 425 |
'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'borderless' ), |
| 426 |
), |
| 427 |
|
| 428 |
array( |
| 429 |
'type' => 'css_editor', |
| 430 |
'heading' => __( 'CSS box', 'borderless' ), |
| 431 |
'param_name' => 'css', |
| 432 |
'group' => __( 'Design Options', 'borderless' ), |
| 433 |
), |
| 434 |
), |
| 435 |
); |
| 436 |
|