| 1 |
<?php |
| 2 |
|
| 3 |
namespace MasterAddons\Addons; |
| 4 |
|
| 5 |
// Elementor Classes |
| 6 |
use MasterAddons\Inc\Classes\Base\Master_Widget; |
| 7 |
use \Elementor\Utils; |
| 8 |
use \Elementor\Icons_Manager; |
| 9 |
use \Elementor\Controls_Manager; |
| 10 |
use \Elementor\Repeater; |
| 11 |
use \Elementor\Switcher; |
| 12 |
use \Elementor\Group_Control_Border; |
| 13 |
use \Elementor\Group_Control_Typography; |
| 14 |
use \Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 15 |
use \Elementor\Group_Control_Image_Size; |
| 16 |
use \Elementor\Group_Control_Background; |
| 17 |
use \Elementor\Group_Control_Box_Shadow; |
| 18 |
use \Elementor\Group_Control_Text_Shadow; |
| 19 |
use \Elementor\Group_Control_Css_Filter; |
| 20 |
use \Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 21 |
use MasterAddons\Inc\Classes\Helper; |
| 22 |
use MasterAddons\Inc\Admin\Theme_Builder\Comments\Comments_Builder; |
| 23 |
use MasterAddons\Inc\Admin\Config; |
| 24 |
|
| 25 |
/** |
| 26 |
* Author Name: Liton Arefin |
| 27 |
* Author URL : https: //jeweltheme.com |
| 28 |
* Date : 22/06/2020 |
| 29 |
*/ |
| 30 |
|
| 31 |
// Exit if accessed directly. |
| 32 |
if (!defined('ABSPATH')) { |
| 33 |
exit; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Master Comments: Master Addons Element |
| 38 |
*/ |
| 39 |
|
| 40 |
class Comments extends Master_Widget |
| 41 |
{ |
| 42 |
use \MasterAddons\Inc\Traits\Widget_Notice; |
| 43 |
use \MasterAddons\Inc\Traits\Widget_Assets_Trait; |
| 44 |
|
| 45 |
public function get_name() |
| 46 |
{ |
| 47 |
return 'jltma-comments'; |
| 48 |
} |
| 49 |
|
| 50 |
public function get_title() |
| 51 |
{ |
| 52 |
return esc_html__('MA Comments', 'master-addons' ); |
| 53 |
} |
| 54 |
|
| 55 |
public function get_categories() |
| 56 |
{ |
| 57 |
return ['general', 'master-addons']; |
| 58 |
} |
| 59 |
|
| 60 |
public function get_icon() |
| 61 |
{ |
| 62 |
return 'jltma-icon ' . Config::get_addon_icon($this->get_name()); |
| 63 |
} |
| 64 |
|
| 65 |
public function get_keywords() |
| 66 |
{ |
| 67 |
return [ |
| 68 |
'comments', |
| 69 |
'comments', |
| 70 |
'disquss', |
| 71 |
'facebook', |
| 72 |
'jetpack', |
| 73 |
'discussion' |
| 74 |
]; |
| 75 |
} |
| 76 |
|
| 77 |
public function get_custom_help_url() |
| 78 |
{ |
| 79 |
return 'https://master-addons.com/demos/comments-builder'; |
| 80 |
} |
| 81 |
|
| 82 |
protected function register_controls() |
| 83 |
{ |
| 84 |
|
| 85 |
/* |
| 86 |
* MA Comments Section |
| 87 |
*/ |
| 88 |
$this->start_controls_section( |
| 89 |
'jltma_comment_section_start', |
| 90 |
[ |
| 91 |
'label' => esc_html__('Comments', 'master-addons' ), |
| 92 |
] |
| 93 |
); |
| 94 |
|
| 95 |
$this->add_control( |
| 96 |
'jltma_comment_style_preset', |
| 97 |
[ |
| 98 |
'label' => esc_html__('Design Presets', 'master-addons' ), |
| 99 |
'type' => Controls_Manager::SELECT, |
| 100 |
'default' => 'style_one', |
| 101 |
'options' => [ |
| 102 |
'style_one' => esc_html__('Modern Style', 'master-addons' ), |
| 103 |
'style_two' => esc_html__('Lounge Style', 'master-addons' ), |
| 104 |
'style_three' => esc_html__('Facebook Style', 'master-addons' ) |
| 105 |
], |
| 106 |
'style_transfer' => true, |
| 107 |
] |
| 108 |
); |
| 109 |
|
| 110 |
$this->add_control( |
| 111 |
'jltma_comment_total_number', |
| 112 |
[ |
| 113 |
'label' => esc_html__('Total Number of Comments', 'master-addons' ), |
| 114 |
'type' => Controls_Manager::SWITCHER, |
| 115 |
'default' => 'show', |
| 116 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 117 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 118 |
'return_value' => 'show', |
| 119 |
'style_transfer' => true, |
| 120 |
] |
| 121 |
); |
| 122 |
|
| 123 |
$this->add_control( |
| 124 |
'jltma_comment_no_comment_text', |
| 125 |
[ |
| 126 |
'label' => esc_html__('No Comments Text', 'master-addons' ), |
| 127 |
'type' => Controls_Manager::TEXT, |
| 128 |
'default' => esc_html__('No Comments', 'master-addons' ), |
| 129 |
'style_transfer' => true, |
| 130 |
'condition' => [ |
| 131 |
'jltma_comment_total_number' => 'show' |
| 132 |
], |
| 133 |
|
| 134 |
] |
| 135 |
); |
| 136 |
|
| 137 |
$this->add_control( |
| 138 |
'jltma_comment_single_comment_text', |
| 139 |
[ |
| 140 |
'label' => esc_html__('One Comment Text', 'master-addons' ), |
| 141 |
'type' => Controls_Manager::TEXT, |
| 142 |
'default' => esc_html__('One Comment', 'master-addons' ), |
| 143 |
'style_transfer' => true, |
| 144 |
'condition' => [ |
| 145 |
'jltma_comment_total_number' => 'show' |
| 146 |
], |
| 147 |
|
| 148 |
] |
| 149 |
); |
| 150 |
$this->add_control( |
| 151 |
'jltma_comment_plural_comment_text', |
| 152 |
[ |
| 153 |
'label' => esc_html__('Multiple Comments Text', 'master-addons' ), |
| 154 |
'type' => Controls_Manager::TEXT, |
| 155 |
'default' => esc_html__('Comments', 'master-addons' ), |
| 156 |
'style_transfer' => true, |
| 157 |
'condition' => [ |
| 158 |
'jltma_comment_total_number' => 'show' |
| 159 |
], |
| 160 |
|
| 161 |
] |
| 162 |
); |
| 163 |
|
| 164 |
$this->add_control( |
| 165 |
'jltma_comment_gravatar', |
| 166 |
[ |
| 167 |
'label' => esc_html__('Show Gravatar', 'master-addons' ), |
| 168 |
'type' => Controls_Manager::SWITCHER, |
| 169 |
'default' => 'show', |
| 170 |
'label_on' => esc_html__('Hide', 'master-addons' ), |
| 171 |
'label_off' => esc_html__('Show', 'master-addons' ), |
| 172 |
'return_value' => 'show', |
| 173 |
'style_transfer' => true, |
| 174 |
] |
| 175 |
); |
| 176 |
|
| 177 |
$this->add_control( |
| 178 |
'jltma_comment_replies', |
| 179 |
[ |
| 180 |
'label' => esc_html__('Show / Hide Replies', 'master-addons' ), |
| 181 |
'type' => Controls_Manager::SWITCHER, |
| 182 |
'default' => 'show', |
| 183 |
'label_on' => esc_html__('Hide', 'master-addons' ), |
| 184 |
'label_off' => esc_html__('Show', 'master-addons' ), |
| 185 |
'return_value' => 'show', |
| 186 |
'style_transfer' => true, |
| 187 |
] |
| 188 |
); |
| 189 |
|
| 190 |
$this->add_control( |
| 191 |
'jltma_comment_ratings', |
| 192 |
[ |
| 193 |
'label' => esc_html__('Comment Rating', 'master-addons' ), |
| 194 |
'type' => Controls_Manager::SWITCHER, |
| 195 |
'default' => 'show', |
| 196 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 197 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 198 |
'return_value' => 'show', |
| 199 |
'style_transfer' => true, |
| 200 |
] |
| 201 |
); |
| 202 |
|
| 203 |
$this->add_control( |
| 204 |
'jltma_comment_pagination', |
| 205 |
[ |
| 206 |
'label' => esc_html__('Enable Pagination', 'master-addons' ), |
| 207 |
'type' => Controls_Manager::SWITCHER, |
| 208 |
'default' => 'yes', |
| 209 |
'label_on' => esc_html__('Yes', 'master-addons' ), |
| 210 |
'label_off' => esc_html__('No', 'master-addons' ), |
| 211 |
'return_value' => 'yes', |
| 212 |
'style_transfer' => true, |
| 213 |
] |
| 214 |
); |
| 215 |
|
| 216 |
$this->add_control( |
| 217 |
'jltma_comment_spam_protection_enable', |
| 218 |
[ |
| 219 |
'label' => esc_html__('Enable reCaptcha', 'master-addons' ), |
| 220 |
'type' => Controls_Manager::SWITCHER, |
| 221 |
'default' => 'no', |
| 222 |
'label_on' => esc_html__('Enable', 'master-addons' ), |
| 223 |
'label_off' => esc_html__('Disable', 'master-addons' ), |
| 224 |
'return_value' => 'yes', |
| 225 |
'style_transfer' => true, |
| 226 |
] |
| 227 |
); |
| 228 |
$this->add_control( |
| 229 |
'jltma_comment_extra_fields_enable', |
| 230 |
[ |
| 231 |
'label' => esc_html__('Enable Extra Comment Fields', 'master-addons' ), |
| 232 |
'type' => Controls_Manager::SWITCHER, |
| 233 |
'default' => 'no', |
| 234 |
'label_on' => esc_html__('Enable', 'master-addons' ), |
| 235 |
'label_off' => esc_html__('Disable', 'master-addons' ), |
| 236 |
'return_value' => 'yes', |
| 237 |
'style_transfer' => true, |
| 238 |
] |
| 239 |
); |
| 240 |
|
| 241 |
$this->add_responsive_control( |
| 242 |
'jltma_comment_pagination_items', |
| 243 |
[ |
| 244 |
'label' => esc_html__('Number Of Comments Per Page', 'master-addons' ), |
| 245 |
'type' => Controls_Manager::SLIDER, |
| 246 |
'default' => ['size' => 10], |
| 247 |
'range' => [ |
| 248 |
'px' => [ |
| 249 |
'min' => 1, |
| 250 |
'max' => 100, |
| 251 |
'step' => 1, |
| 252 |
], |
| 253 |
], |
| 254 |
'size_units' => '', |
| 255 |
'condition' => [ |
| 256 |
'jltma_comment_pagination' => 'yes' |
| 257 |
], |
| 258 |
] |
| 259 |
); |
| 260 |
$this->end_controls_section(); |
| 261 |
|
| 262 |
/** |
| 263 |
* Content Tab: Display Settings |
| 264 |
*/ |
| 265 |
$this->start_controls_section( |
| 266 |
'jltma_comment_section_customization', |
| 267 |
[ |
| 268 |
'label' => esc_html__('Customization Settings', 'master-addons' ), |
| 269 |
] |
| 270 |
); |
| 271 |
|
| 272 |
$this->add_control( |
| 273 |
'jltma_comment_before_notes', |
| 274 |
[ |
| 275 |
'label' => esc_html__('Before Notes Text', 'master-addons' ), |
| 276 |
'type' => Controls_Manager::TEXTAREA, |
| 277 |
'placeholder' => esc_html__('Your email address will not be published.', 'master-addons' ), |
| 278 |
] |
| 279 |
); |
| 280 |
|
| 281 |
$this->add_control( |
| 282 |
'jltma_comment_after_notes', |
| 283 |
[ |
| 284 |
'label' => esc_html__('After Notes Text', 'master-addons' ), |
| 285 |
'type' => Controls_Manager::TEXTAREA, |
| 286 |
'placeholder' => esc_html__('Your email address will not be published.', 'master-addons' ) |
| 287 |
] |
| 288 |
); |
| 289 |
|
| 290 |
$this->add_control( |
| 291 |
'jltma_comment_label', |
| 292 |
[ |
| 293 |
'label' => esc_html__('Comment Label', 'master-addons' ), |
| 294 |
'type' => Controls_Manager::TEXT, |
| 295 |
'default' => esc_html__('Leave A Comment', 'master-addons' ), |
| 296 |
] |
| 297 |
); |
| 298 |
|
| 299 |
$this->add_control( |
| 300 |
'jltma_comment_reply_label', |
| 301 |
[ |
| 302 |
'label' => esc_html__('Reply Button Label', 'master-addons' ), |
| 303 |
'type' => Controls_Manager::TEXT, |
| 304 |
'default' => esc_html__('Reply', 'master-addons' ), |
| 305 |
'condition' => [ |
| 306 |
'jltma_comment_replies' => 'show', |
| 307 |
] |
| 308 |
|
| 309 |
] |
| 310 |
); |
| 311 |
|
| 312 |
$this->add_control( |
| 313 |
'jltma_comment_show_reply_label', |
| 314 |
[ |
| 315 |
'label' => esc_html__('Show Reply Label', 'master-addons' ), |
| 316 |
'type' => Controls_Manager::TEXT, |
| 317 |
'placeholder' => esc_html__('Show Replies', 'master-addons' ), |
| 318 |
'condition' => [ |
| 319 |
'jltma_comment_replies' => 'show', |
| 320 |
] |
| 321 |
|
| 322 |
] |
| 323 |
); |
| 324 |
$this->add_control( |
| 325 |
'jltma_comment_hide_reply_label', |
| 326 |
[ |
| 327 |
'label' => esc_html__('Hide Reply Label', 'master-addons' ), |
| 328 |
'type' => Controls_Manager::TEXT, |
| 329 |
'placeholder' => esc_html__('Hide Replies', 'master-addons' ), |
| 330 |
'condition' => [ |
| 331 |
'jltma_comment_replies' => 'show', |
| 332 |
] |
| 333 |
|
| 334 |
] |
| 335 |
); |
| 336 |
|
| 337 |
$this->add_control( |
| 338 |
'jltma_comment_cancel_reply_label', |
| 339 |
[ |
| 340 |
'label' => esc_html__('Cancel Reply Label', 'master-addons' ), |
| 341 |
'type' => Controls_Manager::TEXT, |
| 342 |
'default' => esc_html__('Cancel Reply', 'master-addons' ) |
| 343 |
] |
| 344 |
); |
| 345 |
|
| 346 |
$this->add_control( |
| 347 |
'jltma_comment_form_submit_label', |
| 348 |
[ |
| 349 |
'label' => esc_html__('Comment Form Submit Label', 'master-addons' ), |
| 350 |
'type' => Controls_Manager::TEXT, |
| 351 |
'default' => esc_html__('Post Comment', 'master-addons' ) |
| 352 |
] |
| 353 |
); |
| 354 |
|
| 355 |
$this->end_controls_section(); |
| 356 |
|
| 357 |
/** |
| 358 |
* Content Tab: SPAM Protection |
| 359 |
*/ |
| 360 |
$this->start_controls_section( |
| 361 |
'jltma_comment_section_spam_protection', |
| 362 |
[ |
| 363 |
'label' => esc_html__('SPAM Protection', 'master-addons' ), |
| 364 |
'condition' => [ |
| 365 |
'jltma_comment_spam_protection_enable' => 'yes', |
| 366 |
] |
| 367 |
] |
| 368 |
); |
| 369 |
|
| 370 |
// Spam Protection - Pro feature via filter (pass $this for Pro to add controls) |
| 371 |
$spam_control_added = apply_filters('master_addons/extensions/header_footer/commen_addon/spam_protection', false, $this); |
| 372 |
|
| 373 |
if (!$spam_control_added) { |
| 374 |
$this->add_control( |
| 375 |
'jltma_comment_spam_protection', |
| 376 |
[ |
| 377 |
'label' => esc_html__('Enable SPAM Protection', 'master-addons'), |
| 378 |
'type' => Controls_Manager::CHOOSE, |
| 379 |
'options' => [ |
| 380 |
'1' => [ |
| 381 |
'title' => esc_html__('', 'master-addons'), |
| 382 |
'icon' => 'eicon-lock', |
| 383 |
], |
| 384 |
], |
| 385 |
'default' => '1', |
| 386 |
'description' => '<span class="pro-feature"> Upgrade to <a href="https://master-addons.com/pricing/" target="_blank">Pro Version</a> to unlock this Option.</span>' |
| 387 |
] |
| 388 |
); |
| 389 |
} |
| 390 |
|
| 391 |
$this->end_controls_section(); |
| 392 |
|
| 393 |
/** |
| 394 |
* Content Tab: Fields Settins |
| 395 |
*/ |
| 396 |
$this->start_controls_section( |
| 397 |
'jltma_comment_section_fields', |
| 398 |
[ |
| 399 |
'label' => esc_html__('Fields Settings', 'master-addons' ), |
| 400 |
] |
| 401 |
); |
| 402 |
|
| 403 |
$this->start_controls_tabs('jltma_comment_section_fields_tab'); |
| 404 |
$this->start_controls_tab('jltma_comment_fields_name_tab', [ |
| 405 |
'label' => esc_html__('Name', 'master-addons' ) |
| 406 |
]); |
| 407 |
|
| 408 |
$this->add_control( |
| 409 |
'jltma_comment_fields_name_label_display', |
| 410 |
[ |
| 411 |
'label' => esc_html__('Display Label?', 'master-addons' ), |
| 412 |
'type' => Controls_Manager::SWITCHER, |
| 413 |
'default' => 'show', |
| 414 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 415 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 416 |
'return_value' => 'show', |
| 417 |
'style_transfer' => true, |
| 418 |
] |
| 419 |
); |
| 420 |
|
| 421 |
$this->add_control( |
| 422 |
'jltma_comment_fields_name_label', |
| 423 |
[ |
| 424 |
'label' => esc_html__('Name', 'master-addons' ), |
| 425 |
'type' => Controls_Manager::TEXT, |
| 426 |
'default' => esc_html__('Name', 'master-addons' ), |
| 427 |
'condition' => [ |
| 428 |
'jltma_comment_fields_name_label_display' => 'show', |
| 429 |
] |
| 430 |
] |
| 431 |
); |
| 432 |
|
| 433 |
$this->add_control( |
| 434 |
'jltma_comment_fields_name_label_placeholder', |
| 435 |
[ |
| 436 |
'label' => esc_html__('Placeholder', 'master-addons' ), |
| 437 |
'type' => Controls_Manager::TEXT, |
| 438 |
'default' => esc_html__('Enter your Name', 'master-addons' ) |
| 439 |
] |
| 440 |
); |
| 441 |
$this->end_controls_tab(); |
| 442 |
|
| 443 |
//Email |
| 444 |
$this->start_controls_tab('jltma_comment_fields_email_tab', [ |
| 445 |
'label' => esc_html__('Email', 'master-addons' ) |
| 446 |
]); |
| 447 |
|
| 448 |
$this->add_control( |
| 449 |
'jltma_comment_fields_email_label_display', |
| 450 |
[ |
| 451 |
'label' => esc_html__('Display Label?', 'master-addons' ), |
| 452 |
'type' => Controls_Manager::SWITCHER, |
| 453 |
'default' => 'show', |
| 454 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 455 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 456 |
'return_value' => 'show', |
| 457 |
'style_transfer' => true, |
| 458 |
] |
| 459 |
); |
| 460 |
|
| 461 |
$this->add_control( |
| 462 |
'jltma_comment_fields_email_label', |
| 463 |
[ |
| 464 |
'label' => esc_html__('Email', 'master-addons' ), |
| 465 |
'type' => Controls_Manager::TEXT, |
| 466 |
'default' => esc_html__('Email', 'master-addons' ), |
| 467 |
'condition' => [ |
| 468 |
'jltma_comment_fields_email_label_display' => 'show', |
| 469 |
] |
| 470 |
] |
| 471 |
); |
| 472 |
|
| 473 |
$this->add_control( |
| 474 |
'jltma_comment_fields_email_label_placeholder', |
| 475 |
[ |
| 476 |
'label' => esc_html__('Placeholder', 'master-addons' ), |
| 477 |
'type' => Controls_Manager::TEXT, |
| 478 |
'default' => esc_html__('Enter your Email', 'master-addons' ) |
| 479 |
] |
| 480 |
); |
| 481 |
|
| 482 |
$this->end_controls_tab(); |
| 483 |
|
| 484 |
//Website |
| 485 |
$this->start_controls_tab('jltma_comment_fields_url_tab', [ |
| 486 |
'label' => esc_html__('Website', 'master-addons' ) |
| 487 |
]); |
| 488 |
|
| 489 |
$this->add_control( |
| 490 |
'jltma_comment_fields_url_display', |
| 491 |
[ |
| 492 |
'label' => esc_html__('Display Field?', 'master-addons' ), |
| 493 |
'type' => Controls_Manager::SWITCHER, |
| 494 |
'default' => 'show', |
| 495 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 496 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 497 |
'return_value' => 'show', |
| 498 |
'style_transfer' => true, |
| 499 |
] |
| 500 |
); |
| 501 |
|
| 502 |
$this->add_control( |
| 503 |
'jltma_comment_fields_url_label_display', |
| 504 |
[ |
| 505 |
'label' => esc_html__('Display Label?', 'master-addons' ), |
| 506 |
'type' => Controls_Manager::SWITCHER, |
| 507 |
'default' => 'show', |
| 508 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 509 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 510 |
'return_value' => 'show', |
| 511 |
'style_transfer' => true, |
| 512 |
'condition' => [ |
| 513 |
'jltma_comment_fields_url_display' => 'show', |
| 514 |
] |
| 515 |
] |
| 516 |
); |
| 517 |
|
| 518 |
$this->add_control( |
| 519 |
'jltma_comment_fields_url_label', |
| 520 |
[ |
| 521 |
'label' => esc_html__('Website', 'master-addons' ), |
| 522 |
'type' => Controls_Manager::TEXT, |
| 523 |
'default' => esc_html__('Website', 'master-addons' ), |
| 524 |
'condition' => [ |
| 525 |
'jltma_comment_fields_url_label_display' => 'show', |
| 526 |
'jltma_comment_fields_url_display' => 'show', |
| 527 |
] |
| 528 |
] |
| 529 |
); |
| 530 |
|
| 531 |
$this->add_control( |
| 532 |
'jltma_comment_fields_url_label_placeholder', |
| 533 |
[ |
| 534 |
'label' => esc_html__('Placeholder', 'master-addons' ), |
| 535 |
'type' => Controls_Manager::TEXT, |
| 536 |
'default' => esc_html__('Enter your Website', 'master-addons' ), |
| 537 |
'condition' => [ |
| 538 |
'jltma_comment_fields_url_display' => 'show', |
| 539 |
] |
| 540 |
] |
| 541 |
); |
| 542 |
|
| 543 |
$this->end_controls_tab(); |
| 544 |
|
| 545 |
//Comment Box |
| 546 |
$this->start_controls_tab('jltma_comment_fields_textarea_tab', [ |
| 547 |
'label' => esc_html__('Comment', 'master-addons' ) |
| 548 |
]); |
| 549 |
|
| 550 |
$this->add_control( |
| 551 |
'jltma_comment_fields_textarea_label_display', |
| 552 |
[ |
| 553 |
'label' => esc_html__('Display Label?', 'master-addons' ), |
| 554 |
'type' => Controls_Manager::SWITCHER, |
| 555 |
'default' => 'show', |
| 556 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 557 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 558 |
'return_value' => 'show', |
| 559 |
'style_transfer' => true, |
| 560 |
] |
| 561 |
); |
| 562 |
|
| 563 |
$this->add_control( |
| 564 |
'jltma_comment_fields_textarea_label', |
| 565 |
[ |
| 566 |
'label' => esc_html__('Comment Box', 'master-addons' ), |
| 567 |
'type' => Controls_Manager::TEXT, |
| 568 |
'default' => esc_html__('Comments', 'master-addons' ), |
| 569 |
'condition' => [ |
| 570 |
'jltma_comment_fields_textarea_label_display' => 'show', |
| 571 |
] |
| 572 |
] |
| 573 |
); |
| 574 |
|
| 575 |
$this->add_control( |
| 576 |
'jltma_comment_fields_textarea_label_placeholder', |
| 577 |
[ |
| 578 |
'label' => esc_html__('Placeholder', 'master-addons' ), |
| 579 |
'type' => Controls_Manager::TEXT, |
| 580 |
'default' => esc_html__('Enter your Comments', 'master-addons' ) |
| 581 |
] |
| 582 |
); |
| 583 |
|
| 584 |
$this->add_control( |
| 585 |
'jltma_comment_fields_textarea_notice', |
| 586 |
[ |
| 587 |
'label' => esc_html__('Display Notice?', 'master-addons' ), |
| 588 |
'type' => Controls_Manager::SWITCHER, |
| 589 |
'default' => 'hide', |
| 590 |
'label_on' => esc_html__('Show', 'master-addons' ), |
| 591 |
'label_off' => esc_html__('Hide', 'master-addons' ), |
| 592 |
'return_value' => 'show', |
| 593 |
'style_transfer' => true, |
| 594 |
] |
| 595 |
); |
| 596 |
|
| 597 |
$this->add_control( |
| 598 |
'jltma_comment_fields_textarea_notice_content', |
| 599 |
[ |
| 600 |
'label' => esc_html__('Content', 'master-addons' ), |
| 601 |
'type' => Controls_Manager::WYSIWYG, |
| 602 |
'default' => esc_html__('Comments are moderated and will only be made live if they add to the discussion in a constructive way. If you disagree with a point, be polite. This should be a conversation between professional people with the aim that we all learn.', 'master-addons' ), |
| 603 |
'condition' => [ |
| 604 |
'jltma_comment_fields_textarea_notice' => 'show', |
| 605 |
], |
| 606 |
] |
| 607 |
); |
| 608 |
|
| 609 |
$this->add_control( |
| 610 |
'jltma_comment_fields_textarea_notice_align', |
| 611 |
[ |
| 612 |
'label' => esc_html__('Alignment', 'master-addons' ), |
| 613 |
'type' => Controls_Manager::CHOOSE, |
| 614 |
'label_block' => false, |
| 615 |
'options' => [ |
| 616 |
'left' => [ |
| 617 |
'title' => esc_html__('Left', 'master-addons' ), |
| 618 |
'icon' => 'eicon-h-align-left', |
| 619 |
], |
| 620 |
'right' => [ |
| 621 |
'title' => esc_html__('Right', 'master-addons' ), |
| 622 |
'icon' => 'eicon-h-align-right', |
| 623 |
], |
| 624 |
], |
| 625 |
'default' => 'right', |
| 626 |
'style_transfer' => true, |
| 627 |
'condition' => [ |
| 628 |
'jltma_comment_fields_textarea_notice' => 'show', |
| 629 |
], |
| 630 |
] |
| 631 |
); |
| 632 |
|
| 633 |
$this->end_controls_tab(); |
| 634 |
|
| 635 |
$this->end_controls_tabs(); |
| 636 |
|
| 637 |
$this->end_controls_section(); |
| 638 |
|
| 639 |
/** |
| 640 |
* Extra Comments Fields: Dynamic Custom Fields Settings |
| 641 |
*/ |
| 642 |
$this->start_controls_section( |
| 643 |
'jltma_comment_extra_fields_sections', |
| 644 |
[ |
| 645 |
'label' => esc_html__('Extra Comment Fields', 'master-addons' ), |
| 646 |
'condition' => [ |
| 647 |
'jltma_comment_extra_fields_enable' => 'yes', |
| 648 |
] |
| 649 |
] |
| 650 |
); |
| 651 |
|
| 652 |
// Extra Fields - Pro feature via filter |
| 653 |
$extra_fields_config = apply_filters('master_addons/extensions/header_footer/commen_addon/extra_fields_items', []); |
| 654 |
|
| 655 |
if (!empty($extra_fields_config)) { |
| 656 |
$this->add_control('jltma_comment_extra_fields_items', $extra_fields_config); |
| 657 |
} else { |
| 658 |
$this->add_responsive_control( |
| 659 |
'jltma_comment_extra_fields_section_repeater', |
| 660 |
[ |
| 661 |
'label' => __('Comment Extra Fields', 'master-addons'), |
| 662 |
'type' => Controls_Manager::CHOOSE, |
| 663 |
'options' => [ |
| 664 |
'1' => [ |
| 665 |
'title' => esc_html__('', 'master-addons'), |
| 666 |
'icon' => 'eicon-lock', |
| 667 |
], |
| 668 |
], |
| 669 |
'default' => '1', |
| 670 |
'description' => '<span class="pro-feature"> Upgrade to <a href="' . ma_el_fs()->get_upgrade_url() . '" target="_blank">Pro Version</a> to unlock this Option.</span>' |
| 671 |
] |
| 672 |
); |
| 673 |
} |
| 674 |
|
| 675 |
$this->end_controls_section(); |
| 676 |
|
| 677 |
/* Master Comment: Style Tab */ |
| 678 |
$this->start_controls_section( |
| 679 |
'jltma_comments_style_start', |
| 680 |
[ |
| 681 |
'label' => esc_html__('Comment Box', 'master-addons' ), |
| 682 |
'tab' => Controls_Manager::TAB_STYLE |
| 683 |
] |
| 684 |
); |
| 685 |
|
| 686 |
$this->add_control( |
| 687 |
'jltma_comments_bg_color', |
| 688 |
[ |
| 689 |
'label' => esc_html__('Background Color', 'master-addons' ), |
| 690 |
'type' => Controls_Manager::COLOR, |
| 691 |
'default' => '', |
| 692 |
'selectors' => [ |
| 693 |
'{{WRAPPER}} .jltma-comments-wrap' => 'background: {{VALUE}};' |
| 694 |
] |
| 695 |
] |
| 696 |
); |
| 697 |
|
| 698 |
$this->add_control( |
| 699 |
'jltma_comments_total', |
| 700 |
[ |
| 701 |
'label' => esc_html__('Total Number Comments', 'master-addons' ), |
| 702 |
'type' => Controls_Manager::HEADING, |
| 703 |
'separator' => 'before', |
| 704 |
] |
| 705 |
); |
| 706 |
$this->add_group_control( |
| 707 |
Group_Control_Typography::get_type(), |
| 708 |
[ |
| 709 |
'name' => 'jltma_comments_total_typography', |
| 710 |
'selector' => '{{WRAPPER}} .jltma-comments-title', |
| 711 |
'global' => [ |
| 712 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 713 |
], |
| 714 |
] |
| 715 |
); |
| 716 |
|
| 717 |
$this->add_control( |
| 718 |
'jltma_comments_total_color', |
| 719 |
[ |
| 720 |
'label' => esc_html__('Total Comments Color', 'master-addons' ), |
| 721 |
'type' => Controls_Manager::COLOR, |
| 722 |
'global' => [ |
| 723 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 724 |
], |
| 725 |
'default' => '#000', |
| 726 |
'selectors' => [ |
| 727 |
'{{WRAPPER}} .jltma-comments-title' => 'color: {{VALUE}};' |
| 728 |
], |
| 729 |
] |
| 730 |
); |
| 731 |
|
| 732 |
$this->add_responsive_control( |
| 733 |
'jltma_comments_pading', |
| 734 |
[ |
| 735 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 736 |
'type' => Controls_Manager::DIMENSIONS, |
| 737 |
'size_units' => ['px', 'em', '%'], |
| 738 |
'separator' => 'before', |
| 739 |
'selectors' => [ |
| 740 |
'{{WRAPPER}} .jltma-comments-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 741 |
] |
| 742 |
] |
| 743 |
); |
| 744 |
|
| 745 |
$this->add_responsive_control( |
| 746 |
'jltma_comments_margin', |
| 747 |
[ |
| 748 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 749 |
'type' => Controls_Manager::DIMENSIONS, |
| 750 |
'size_units' => ['px', 'em', '%'], |
| 751 |
'selectors' => [ |
| 752 |
'{{WRAPPER}} .jltma-comments-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 753 |
] |
| 754 |
] |
| 755 |
); |
| 756 |
|
| 757 |
$this->add_group_control( |
| 758 |
Group_Control_Border::get_type(), |
| 759 |
[ |
| 760 |
'name' => 'jltma_comments_border', |
| 761 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap' |
| 762 |
] |
| 763 |
); |
| 764 |
|
| 765 |
$this->add_responsive_control( |
| 766 |
'jltma_comments_border_radius', |
| 767 |
[ |
| 768 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 769 |
'type' => Controls_Manager::DIMENSIONS, |
| 770 |
'size_units' => ['px', '%', 'em'], |
| 771 |
'selectors' => [ |
| 772 |
'{{WRAPPER}} .jltma-comments-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 773 |
] |
| 774 |
] |
| 775 |
); |
| 776 |
|
| 777 |
$this->add_group_control( |
| 778 |
Group_Control_Box_Shadow::get_type(), |
| 779 |
[ |
| 780 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 781 |
'name' => 'jltma_comments_box_shadow', |
| 782 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap' |
| 783 |
] |
| 784 |
); |
| 785 |
|
| 786 |
$this->end_controls_section(); |
| 787 |
|
| 788 |
/* Master Comment Item: Style Tab */ |
| 789 |
$this->start_controls_section( |
| 790 |
'jltma_comment_style_start', |
| 791 |
[ |
| 792 |
'label' => esc_html__('Comment Item', 'master-addons' ), |
| 793 |
'tab' => Controls_Manager::TAB_STYLE |
| 794 |
] |
| 795 |
); |
| 796 |
|
| 797 |
$this->add_control( |
| 798 |
'jltma_comment_bg_color', |
| 799 |
[ |
| 800 |
'label' => esc_html__('Background Color', 'master-addons' ), |
| 801 |
'type' => Controls_Manager::COLOR, |
| 802 |
'default' => '', |
| 803 |
'selectors' => [ |
| 804 |
'{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list' => 'background: {{VALUE}};' |
| 805 |
] |
| 806 |
] |
| 807 |
); |
| 808 |
|
| 809 |
// Comment Item Styles |
| 810 |
$this->start_controls_tabs('jltma_comment_author_section'); |
| 811 |
|
| 812 |
$this->start_controls_tab('jltma_comment_author_tab_style', [ |
| 813 |
'label' => esc_html__('Author', 'master-addons' ) |
| 814 |
]); |
| 815 |
$this->add_group_control( |
| 816 |
Group_Control_Typography::get_type(), |
| 817 |
[ |
| 818 |
'name' => 'jltma_comment_author_name_typography', |
| 819 |
'label' => esc_html__('Author Name Typography', 'master-addons' ), |
| 820 |
'selector' => '{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-author-name', |
| 821 |
'global' => [ |
| 822 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 823 |
], |
| 824 |
] |
| 825 |
); |
| 826 |
|
| 827 |
$this->add_control( |
| 828 |
'jltma_comment_author_name_color', |
| 829 |
[ |
| 830 |
'label' => esc_html__('Author Name Color', 'master-addons' ), |
| 831 |
'type' => Controls_Manager::COLOR, |
| 832 |
'global' => [ |
| 833 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 834 |
], |
| 835 |
'default' => '#46494c', |
| 836 |
'selectors' => [ |
| 837 |
'{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-author-name' => 'color: {{VALUE}};' |
| 838 |
], |
| 839 |
] |
| 840 |
); |
| 841 |
|
| 842 |
$this->add_group_control( |
| 843 |
Group_Control_Text_Shadow::get_type(), |
| 844 |
[ |
| 845 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 846 |
'name' => 'jltma_comment_author_name_text_shadow', |
| 847 |
'selector' => '{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-author-name' |
| 848 |
] |
| 849 |
); |
| 850 |
|
| 851 |
$this->end_controls_tab(); |
| 852 |
|
| 853 |
// Gravatar |
| 854 |
$this->start_controls_tab('jltma_comment_gravatar_tab_style', [ |
| 855 |
'label' => esc_html__('Gravatar', 'master-addons' ) |
| 856 |
]); |
| 857 |
|
| 858 |
$this->add_responsive_control( |
| 859 |
'jltma_comment_gravatar_size', |
| 860 |
[ |
| 861 |
'label' => esc_html__('Size', 'master-addons' ), |
| 862 |
'type' => Controls_Manager::SLIDER, |
| 863 |
'default' => [ |
| 864 |
'size' => 130 |
| 865 |
], |
| 866 |
'range' => [ |
| 867 |
'px' => [ |
| 868 |
'min' => 1, |
| 869 |
'max' => 350, |
| 870 |
'step' => 1, |
| 871 |
], |
| 872 |
], |
| 873 |
'size_units' => '', |
| 874 |
'condition' => [ |
| 875 |
'jltma_comment_gravatar' => 'show' |
| 876 |
], |
| 877 |
'selectors' => [ |
| 878 |
'{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar' => "width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};" |
| 879 |
] |
| 880 |
] |
| 881 |
); |
| 882 |
|
| 883 |
$this->add_responsive_control( |
| 884 |
'jltma_comment_gravatar_pading', |
| 885 |
[ |
| 886 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 887 |
'type' => Controls_Manager::DIMENSIONS, |
| 888 |
'size_units' => ['px', 'em', '%'], |
| 889 |
'separator' => 'before', |
| 890 |
'selectors' => [ |
| 891 |
'{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 892 |
] |
| 893 |
] |
| 894 |
); |
| 895 |
|
| 896 |
$this->add_responsive_control( |
| 897 |
'jltma_comment_gravatar_margin', |
| 898 |
[ |
| 899 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 900 |
'type' => Controls_Manager::DIMENSIONS, |
| 901 |
'size_units' => ['px', 'em', '%'], |
| 902 |
'selectors' => [ |
| 903 |
'{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 904 |
] |
| 905 |
] |
| 906 |
); |
| 907 |
|
| 908 |
$this->add_group_control( |
| 909 |
Group_Control_Border::get_type(), |
| 910 |
[ |
| 911 |
'name' => 'jltma_comment_gravatar_border', |
| 912 |
'selector' => '{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar img' |
| 913 |
] |
| 914 |
); |
| 915 |
|
| 916 |
$this->add_responsive_control( |
| 917 |
'jltma_comment_gravatar_border_radius', |
| 918 |
[ |
| 919 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 920 |
'type' => Controls_Manager::DIMENSIONS, |
| 921 |
'size_units' => ['px', '%', 'em'], |
| 922 |
'selectors' => [ |
| 923 |
'{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 924 |
] |
| 925 |
] |
| 926 |
); |
| 927 |
|
| 928 |
$this->add_group_control( |
| 929 |
Group_Control_Box_Shadow::get_type(), |
| 930 |
[ |
| 931 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 932 |
'name' => 'jltma_comment_gravatar_box_shadow', |
| 933 |
'selector' => '{{WRAPPER}} .jltma-comment-list .jltma-comment-gravatar img' |
| 934 |
] |
| 935 |
); |
| 936 |
|
| 937 |
$this->end_controls_tab(); |
| 938 |
|
| 939 |
// Comment Text |
| 940 |
$this->start_controls_tab('jltma_comment_author_commentstyle', [ |
| 941 |
'label' => esc_html__('Comments', 'master-addons' ) |
| 942 |
]); |
| 943 |
|
| 944 |
$this->add_group_control( |
| 945 |
Group_Control_Typography::get_type(), |
| 946 |
[ |
| 947 |
'name' => 'jltma_comment_author_comment_typography', |
| 948 |
'selector' => '{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-comment', |
| 949 |
'global' => [ |
| 950 |
'default' => Global_Typography::TYPOGRAPHY_TEXT, |
| 951 |
], |
| 952 |
] |
| 953 |
); |
| 954 |
|
| 955 |
$this->add_control( |
| 956 |
'jltma_comment_author_comment_color', |
| 957 |
[ |
| 958 |
'label' => esc_html__('Total Comments Color', 'master-addons' ), |
| 959 |
'type' => Controls_Manager::COLOR, |
| 960 |
'global' => [ |
| 961 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 962 |
], |
| 963 |
'default' => '#5a5e63', |
| 964 |
'selectors' => [ |
| 965 |
'{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-comment' => 'color: {{VALUE}};' |
| 966 |
], |
| 967 |
] |
| 968 |
); |
| 969 |
|
| 970 |
$this->add_group_control( |
| 971 |
Group_Control_Text_Shadow::get_type(), |
| 972 |
[ |
| 973 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 974 |
'name' => 'jltma_comment_author_comment_text_shadow', |
| 975 |
'selector' => '{{WRAPPER}} .jltma-comment-listing-wrapper .jltma-comment-list .jltma-comment' |
| 976 |
] |
| 977 |
); |
| 978 |
|
| 979 |
$this->end_controls_tab(); |
| 980 |
|
| 981 |
$this->end_controls_tabs(); |
| 982 |
|
| 983 |
$this->add_control( |
| 984 |
'jltma_comments_time_settings', |
| 985 |
[ |
| 986 |
'label' => esc_html__('Comment Datetime Settings', 'master-addons' ), |
| 987 |
'type' => Controls_Manager::HEADING, |
| 988 |
'separator' => 'before', |
| 989 |
] |
| 990 |
); |
| 991 |
|
| 992 |
$this->add_control( |
| 993 |
'jltma_comments_time_type', |
| 994 |
array( |
| 995 |
'label' => esc_html__('Type of Datetime', 'master-addons' ), |
| 996 |
'type' => Controls_Manager::SELECT, |
| 997 |
'default' => 'custom', |
| 998 |
'options' => array( |
| 999 |
'custom' => esc_html__('Custom', 'master-addons' ), |
| 1000 |
'mysql' => esc_html__('MySql', 'master-addons' ), |
| 1001 |
'timestamp' => esc_html__('TimeStamp', 'master-addons' ) |
| 1002 |
) |
| 1003 |
) |
| 1004 |
); |
| 1005 |
|
| 1006 |
$this->add_control( |
| 1007 |
'jltma_comments_time_format', |
| 1008 |
array( |
| 1009 |
'label' => esc_html__('Datetime Format String', 'master-addons' ), |
| 1010 |
'type' => Controls_Manager::TEXT, |
| 1011 |
'default' => get_option('date_format'), |
| 1012 |
'description' => '<span class="pro-feature"> <a href="' . esc_url_raw('https://wordpress.org/support/article/formatting-date-and-time/') . '" target="_blank">Date Time Format Examples </a> </span>', |
| 1013 |
'condition' => array( |
| 1014 |
'jltma_comments_time_type' => array('custom'), |
| 1015 |
) |
| 1016 |
) |
| 1017 |
); |
| 1018 |
|
| 1019 |
$this->add_control( |
| 1020 |
'jltma_comments_time_color', |
| 1021 |
[ |
| 1022 |
'label' => esc_html__('Datetime Color', 'master-addons' ), |
| 1023 |
'type' => Controls_Manager::COLOR, |
| 1024 |
'global' => [ |
| 1025 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1026 |
], |
| 1027 |
'default' => '', |
| 1028 |
'selectors' => [ |
| 1029 |
'{{WRAPPER}} .jltma-title-date .jltma-date-time' => 'color: {{VALUE}};' |
| 1030 |
], |
| 1031 |
] |
| 1032 |
); |
| 1033 |
|
| 1034 |
$this->add_group_control( |
| 1035 |
Group_Control_Typography::get_type(), |
| 1036 |
[ |
| 1037 |
'name' => 'jltma_comments_time_typography', |
| 1038 |
'separator' => 'after', |
| 1039 |
'selector' => '{{WRAPPER}} .jltma-title-date .jltma-date-time', |
| 1040 |
'global' => [ |
| 1041 |
'default' => Global_Typography::TYPOGRAPHY_TEXT, |
| 1042 |
], |
| 1043 |
] |
| 1044 |
); |
| 1045 |
|
| 1046 |
$this->add_control( |
| 1047 |
'jltma_comments_like_dislike_settings', |
| 1048 |
[ |
| 1049 |
'label' => esc_html__('Like/Dislike Settings', 'master-addons' ), |
| 1050 |
'type' => Controls_Manager::HEADING, |
| 1051 |
'separator' => 'before', |
| 1052 |
'condition' => [ |
| 1053 |
'jltma_comment_ratings' => 'show' |
| 1054 |
], |
| 1055 |
] |
| 1056 |
); |
| 1057 |
|
| 1058 |
$this->add_control( |
| 1059 |
'jltma_comments_like_dislike_icon_color', |
| 1060 |
[ |
| 1061 |
'label' => esc_html__('Like/Dislike Icon Color', 'master-addons' ), |
| 1062 |
'type' => Controls_Manager::COLOR, |
| 1063 |
'global' => [ |
| 1064 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1065 |
], |
| 1066 |
'default' => '#393c3f', |
| 1067 |
'selectors' => [ |
| 1068 |
'{{WRAPPER}} .jltma-like-dislike-wrapper .fa' => 'color: {{VALUE}};' |
| 1069 |
], |
| 1070 |
'condition' => [ |
| 1071 |
'jltma_comment_ratings' => 'show' |
| 1072 |
] |
| 1073 |
] |
| 1074 |
); |
| 1075 |
|
| 1076 |
$this->add_control( |
| 1077 |
'jltma_comments_like_dislike_number_color', |
| 1078 |
[ |
| 1079 |
'label' => esc_html__('Like/Dislike Number Color', 'master-addons' ), |
| 1080 |
'type' => Controls_Manager::COLOR, |
| 1081 |
'global' => [ |
| 1082 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1083 |
], |
| 1084 |
'default' => '', |
| 1085 |
'selectors' => [ |
| 1086 |
'{{WRAPPER}} .jltma-like-dislike-wrapper .jltma-like-count-wrap, |
| 1087 |
{{WRAPPER}} .jltma-like-dislike-wrapper .jltma-dislike-count-wrap' => 'color: {{VALUE}};' |
| 1088 |
], |
| 1089 |
'condition' => [ |
| 1090 |
'jltma_comment_ratings' => 'show' |
| 1091 |
] |
| 1092 |
] |
| 1093 |
); |
| 1094 |
|
| 1095 |
$this->add_responsive_control( |
| 1096 |
'jltma_comment_pading', |
| 1097 |
[ |
| 1098 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1099 |
'type' => Controls_Manager::DIMENSIONS, |
| 1100 |
'size_units' => ['px', 'em', '%'], |
| 1101 |
'separator' => 'before', |
| 1102 |
'selectors' => [ |
| 1103 |
'{{WRAPPER}} .jltma-comments-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1104 |
] |
| 1105 |
] |
| 1106 |
); |
| 1107 |
|
| 1108 |
$this->add_responsive_control( |
| 1109 |
'jltma_comment_margin', |
| 1110 |
[ |
| 1111 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1112 |
'type' => Controls_Manager::DIMENSIONS, |
| 1113 |
'size_units' => ['px', 'em', '%'], |
| 1114 |
'selectors' => [ |
| 1115 |
'{{WRAPPER}} .jltma-comments-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1116 |
] |
| 1117 |
] |
| 1118 |
); |
| 1119 |
|
| 1120 |
$this->add_group_control( |
| 1121 |
Group_Control_Border::get_type(), |
| 1122 |
[ |
| 1123 |
'name' => 'jltma_comments_comment_border', |
| 1124 |
'selector' => '{{WRAPPER}} .jltma-comment-listing-wrapper > ul.jltma-comment-list' |
| 1125 |
] |
| 1126 |
); |
| 1127 |
|
| 1128 |
$this->add_responsive_control( |
| 1129 |
'jltma_comment_border_radius', |
| 1130 |
[ |
| 1131 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1132 |
'type' => Controls_Manager::DIMENSIONS, |
| 1133 |
'size_units' => ['px', '%', 'em'], |
| 1134 |
'selectors' => [ |
| 1135 |
'{{WRAPPER}} .jltma-comments-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1136 |
] |
| 1137 |
] |
| 1138 |
); |
| 1139 |
|
| 1140 |
$this->add_group_control( |
| 1141 |
Group_Control_Box_Shadow::get_type(), |
| 1142 |
[ |
| 1143 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1144 |
'name' => 'jltma_comment_box_shadow', |
| 1145 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap' |
| 1146 |
] |
| 1147 |
); |
| 1148 |
|
| 1149 |
$this->end_controls_section(); |
| 1150 |
|
| 1151 |
// Reply Settings |
| 1152 |
$this->start_controls_section( |
| 1153 |
'jltma_comments_reply_section_start', |
| 1154 |
[ |
| 1155 |
'label' => esc_html__('Reply Settings', 'master-addons' ), |
| 1156 |
'tab' => Controls_Manager::TAB_STYLE |
| 1157 |
] |
| 1158 |
); |
| 1159 |
|
| 1160 |
$this->add_control( |
| 1161 |
'jltma_comments_child_reply_settings', |
| 1162 |
[ |
| 1163 |
'label' => esc_html__('Children Replies Settings', 'master-addons' ), |
| 1164 |
'type' => Controls_Manager::HEADING, |
| 1165 |
'separator' => 'before' |
| 1166 |
] |
| 1167 |
); |
| 1168 |
|
| 1169 |
$this->add_control( |
| 1170 |
'jltma_comments_replies_bg_color', |
| 1171 |
[ |
| 1172 |
'label' => esc_html__('Replies Background', 'master-addons' ), |
| 1173 |
'type' => Controls_Manager::COLOR, |
| 1174 |
'global' => [ |
| 1175 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1176 |
], |
| 1177 |
'default' => '', |
| 1178 |
'selectors' => [ |
| 1179 |
'{{WRAPPER}} .jltma-children.jltma-comment-list' => 'background: {{VALUE}} !important;' |
| 1180 |
] |
| 1181 |
] |
| 1182 |
); |
| 1183 |
|
| 1184 |
$this->add_responsive_control( |
| 1185 |
'jltma_comments_replies_pading', |
| 1186 |
[ |
| 1187 |
'label' => esc_html__('Replies Padding', 'master-addons' ), |
| 1188 |
'type' => Controls_Manager::DIMENSIONS, |
| 1189 |
'size_units' => ['px', 'em', '%'], |
| 1190 |
'separator' => 'before', |
| 1191 |
'selectors' => [ |
| 1192 |
'{{WRAPPER}} .jltma-children.jltma-comment-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1193 |
] |
| 1194 |
] |
| 1195 |
); |
| 1196 |
|
| 1197 |
$this->add_responsive_control( |
| 1198 |
'jltma_comments_replies_margin', |
| 1199 |
[ |
| 1200 |
'label' => esc_html__('Replies Margin', 'master-addons' ), |
| 1201 |
'type' => Controls_Manager::DIMENSIONS, |
| 1202 |
'size_units' => ['px', 'em', '%'], |
| 1203 |
'default' => [ |
| 1204 |
'top' => 0, |
| 1205 |
'right' => 0, |
| 1206 |
'bottom' => 40, |
| 1207 |
'left' => 40, |
| 1208 |
'isLinked' => true, |
| 1209 |
], |
| 1210 |
'selectors' => [ |
| 1211 |
'{{WRAPPER}} .jltma-children.jltma-comment-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1212 |
] |
| 1213 |
] |
| 1214 |
); |
| 1215 |
|
| 1216 |
$this->add_group_control( |
| 1217 |
Group_Control_Border::get_type(), |
| 1218 |
[ |
| 1219 |
'name' => 'jltma_comments_replies_border', |
| 1220 |
'selector' => '{{WRAPPER}} .jltma-children.jltma-comment-list' |
| 1221 |
] |
| 1222 |
); |
| 1223 |
|
| 1224 |
$this->add_responsive_control( |
| 1225 |
'jltma_comments_replies_border_radius', |
| 1226 |
[ |
| 1227 |
'label' => esc_html__('Repies Border Radius', 'master-addons' ), |
| 1228 |
'type' => Controls_Manager::DIMENSIONS, |
| 1229 |
'size_units' => ['px', '%', 'em'], |
| 1230 |
'selectors' => [ |
| 1231 |
'{{WRAPPER}} .jltma-children.jltma-comment-list' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1232 |
] |
| 1233 |
] |
| 1234 |
); |
| 1235 |
|
| 1236 |
$this->add_group_control( |
| 1237 |
Group_Control_Box_Shadow::get_type(), |
| 1238 |
[ |
| 1239 |
'label' => esc_html__('Repies Box Shadow', 'master-addons' ), |
| 1240 |
'name' => 'jltma_comments_replies_box_shadow', |
| 1241 |
'selector' => '{{WRAPPER}} .jltma-children.jltma-comment-list' |
| 1242 |
] |
| 1243 |
); |
| 1244 |
|
| 1245 |
$this->add_control( |
| 1246 |
'jltma_comments_reply_settings', |
| 1247 |
[ |
| 1248 |
'label' => esc_html__('Reply Button Settings', 'master-addons' ), |
| 1249 |
'type' => Controls_Manager::HEADING, |
| 1250 |
'separator' => 'before' |
| 1251 |
] |
| 1252 |
); |
| 1253 |
|
| 1254 |
$this->start_controls_tabs('jltma_comments_reply_tabs'); |
| 1255 |
|
| 1256 |
$this->start_controls_tab('jltma_comments_reply_tab', [ |
| 1257 |
'label' => esc_html__('Normal', 'master-addons' ) |
| 1258 |
]); |
| 1259 |
|
| 1260 |
$this->add_control( |
| 1261 |
'jltma_comments_reply_btn_bg_color', |
| 1262 |
[ |
| 1263 |
'label' => esc_html__('Reply BG Color', 'master-addons' ), |
| 1264 |
'type' => Controls_Manager::COLOR, |
| 1265 |
'global' => [ |
| 1266 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1267 |
], |
| 1268 |
'default' => '', |
| 1269 |
'selectors' => [ |
| 1270 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, |
| 1271 |
{{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger' => 'background: {{VALUE}};' |
| 1272 |
] |
| 1273 |
] |
| 1274 |
); |
| 1275 |
|
| 1276 |
$this->add_control( |
| 1277 |
'jltma_comments_reply_text_color', |
| 1278 |
[ |
| 1279 |
'label' => esc_html__('Reply Text Color', 'master-addons' ), |
| 1280 |
'type' => Controls_Manager::COLOR, |
| 1281 |
'global' => [ |
| 1282 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1283 |
], |
| 1284 |
'default' => '#78909c', |
| 1285 |
'selectors' => [ |
| 1286 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, |
| 1287 |
{{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger' => 'color: {{VALUE}};' |
| 1288 |
], |
| 1289 |
] |
| 1290 |
); |
| 1291 |
|
| 1292 |
$this->add_group_control( |
| 1293 |
Group_Control_Typography::get_type(), |
| 1294 |
[ |
| 1295 |
'name' => 'jltma_comments_reply_typography', |
| 1296 |
'label' => esc_html__('Reply Typography', 'master-addons' ), |
| 1297 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, {{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger', |
| 1298 |
'global' => [ |
| 1299 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1300 |
], |
| 1301 |
] |
| 1302 |
); |
| 1303 |
|
| 1304 |
$this->add_group_control( |
| 1305 |
Group_Control_Border::get_type(), |
| 1306 |
[ |
| 1307 |
'name' => 'jltma_comments_reply_border', |
| 1308 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, {{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger' |
| 1309 |
] |
| 1310 |
); |
| 1311 |
|
| 1312 |
$this->add_responsive_control( |
| 1313 |
'jltma_comments_reply_border_radius', |
| 1314 |
[ |
| 1315 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1316 |
'type' => Controls_Manager::DIMENSIONS, |
| 1317 |
'size_units' => ['px', '%', 'em'], |
| 1318 |
'selectors' => [ |
| 1319 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, |
| 1320 |
{{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1321 |
] |
| 1322 |
] |
| 1323 |
); |
| 1324 |
|
| 1325 |
$this->add_group_control( |
| 1326 |
Group_Control_Box_Shadow::get_type(), |
| 1327 |
[ |
| 1328 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1329 |
'name' => 'jltma_comments_reply_shadow', |
| 1330 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button, {{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger' |
| 1331 |
] |
| 1332 |
); |
| 1333 |
|
| 1334 |
$this->end_controls_tab(); |
| 1335 |
|
| 1336 |
//Hover |
| 1337 |
$this->start_controls_tab('jltma_comments_reply_hover_tabs', [ |
| 1338 |
'label' => esc_html__('Hover', 'master-addons' ) |
| 1339 |
]); |
| 1340 |
$this->add_control( |
| 1341 |
'jltma_comments_reply_hover_btn_bg_color', |
| 1342 |
[ |
| 1343 |
'label' => esc_html__('Reply BG Color', 'master-addons' ), |
| 1344 |
'type' => Controls_Manager::COLOR, |
| 1345 |
'global' => [ |
| 1346 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1347 |
], |
| 1348 |
'default' => '', |
| 1349 |
'selectors' => [ |
| 1350 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, |
| 1351 |
{{WRAPPER}} .jltma-comment-style_one .jltma-comment-footer a.jltma-show-replies-trigger:hover' => 'background: {{VALUE}};' |
| 1352 |
] |
| 1353 |
] |
| 1354 |
); |
| 1355 |
|
| 1356 |
$this->add_control( |
| 1357 |
'jltma_comments_reply_hover_text_color', |
| 1358 |
[ |
| 1359 |
'label' => esc_html__('Reply Text Color', 'master-addons' ), |
| 1360 |
'type' => Controls_Manager::COLOR, |
| 1361 |
'global' => [ |
| 1362 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 1363 |
], |
| 1364 |
'default' => '#fff', |
| 1365 |
'selectors' => [ |
| 1366 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, |
| 1367 |
{{WRAPPER}} .jltma-comment-style_one .jltma-comment-footer a.jltma-show-replies-trigger:hover' => 'color: {{VALUE}};' |
| 1368 |
], |
| 1369 |
] |
| 1370 |
); |
| 1371 |
|
| 1372 |
$this->add_group_control( |
| 1373 |
Group_Control_Typography::get_type(), |
| 1374 |
[ |
| 1375 |
'name' => 'jltma_comments_reply_hover_typography', |
| 1376 |
'label' => esc_html__('Reply Typography', 'master-addons' ), |
| 1377 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, {{WRAPPER}} .jltma-comment-style_one .jltma-comment-footer a.jltma-show-replies-trigger:hover', |
| 1378 |
'global' => [ |
| 1379 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1380 |
], |
| 1381 |
] |
| 1382 |
); |
| 1383 |
|
| 1384 |
$this->add_group_control( |
| 1385 |
Group_Control_Border::get_type(), |
| 1386 |
[ |
| 1387 |
'name' => 'jltma_comments_reply_hover_border', |
| 1388 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, {{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger:hover' |
| 1389 |
] |
| 1390 |
); |
| 1391 |
|
| 1392 |
$this->add_responsive_control( |
| 1393 |
'jltma_comments_reply_hover_border_radius', |
| 1394 |
[ |
| 1395 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1396 |
'type' => Controls_Manager::DIMENSIONS, |
| 1397 |
'size_units' => ['px', '%', 'em'], |
| 1398 |
'selectors' => [ |
| 1399 |
'{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, |
| 1400 |
{{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1401 |
] |
| 1402 |
] |
| 1403 |
); |
| 1404 |
|
| 1405 |
$this->add_group_control( |
| 1406 |
Group_Control_Box_Shadow::get_type(), |
| 1407 |
[ |
| 1408 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1409 |
'name' => 'jltma_comments_reply_hover_shadow', |
| 1410 |
'selector' => '{{WRAPPER}} .jltma-comment-footer .jltma-reply-button:hover, {{WRAPPER}} .jltma-comment-footer a.jltma-show-replies-trigger:hover' |
| 1411 |
] |
| 1412 |
); |
| 1413 |
|
| 1414 |
$this->end_controls_tab(); |
| 1415 |
$this->end_controls_tabs(); |
| 1416 |
|
| 1417 |
$this->add_control( |
| 1418 |
'jltma_comments_show_reply_heading', |
| 1419 |
[ |
| 1420 |
'label' => esc_html__('Reply/Show Replies Button', 'master-addons' ), |
| 1421 |
'type' => Controls_Manager::HEADING, |
| 1422 |
'separator' => 'before', |
| 1423 |
] |
| 1424 |
); |
| 1425 |
|
| 1426 |
$this->add_responsive_control( |
| 1427 |
'jltma_comments_reply_show_pading', |
| 1428 |
[ |
| 1429 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1430 |
'type' => Controls_Manager::DIMENSIONS, |
| 1431 |
'size_units' => ['px', 'em', '%'], |
| 1432 |
'separator' => 'before', |
| 1433 |
'selectors' => [ |
| 1434 |
'{{WRAPPER}} .jltma-comment-style_one .jltma-body .jltma-edit-comments-wrapper, |
| 1435 |
{{WRAPPER}} .jltma-comment-style_one .jltma-body .jltma-reply-button, |
| 1436 |
{{WRAPPER}} .jltma-comment-style_two .jltma-body .jltma-reply-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1437 |
] |
| 1438 |
] |
| 1439 |
); |
| 1440 |
|
| 1441 |
$this->end_controls_section(); |
| 1442 |
|
| 1443 |
// Comment Form |
| 1444 |
$this->start_controls_section( |
| 1445 |
'jltma_comments_form_start', |
| 1446 |
[ |
| 1447 |
'label' => esc_html__('Comment Form', 'master-addons' ), |
| 1448 |
'tab' => Controls_Manager::TAB_STYLE |
| 1449 |
] |
| 1450 |
); |
| 1451 |
|
| 1452 |
$this->add_group_control( |
| 1453 |
Group_Control_Background::get_type(), |
| 1454 |
[ |
| 1455 |
'name' => 'jltma_comments_form_background', |
| 1456 |
'label' => esc_html__('Background', 'master-addons' ), |
| 1457 |
'types' => ['classic', 'gradient'], |
| 1458 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap .comment-respond', |
| 1459 |
] |
| 1460 |
); |
| 1461 |
|
| 1462 |
$this->add_group_control( |
| 1463 |
Group_Control_Typography::get_type(), |
| 1464 |
[ |
| 1465 |
'name' => 'jltma_comments_form_typography', |
| 1466 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap .comment-respond', |
| 1467 |
'global' => [ |
| 1468 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1469 |
], |
| 1470 |
] |
| 1471 |
); |
| 1472 |
|
| 1473 |
$this->add_control( |
| 1474 |
'jltma_comments_form_width', |
| 1475 |
[ |
| 1476 |
'label' => esc_html__('Form Width', 'master-addons' ), |
| 1477 |
'type' => Controls_Manager::SLIDER, |
| 1478 |
'size_units' => ['px', 'em', '%'], |
| 1479 |
'range' => [ |
| 1480 |
'px' => [ |
| 1481 |
'min' => 10, |
| 1482 |
'max' => 1500, |
| 1483 |
], |
| 1484 |
'em' => [ |
| 1485 |
'min' => 1, |
| 1486 |
'max' => 80, |
| 1487 |
], |
| 1488 |
], |
| 1489 |
'default' => [ |
| 1490 |
'unit' => '%', |
| 1491 |
'size' => '100' |
| 1492 |
], |
| 1493 |
'selectors' => [ |
| 1494 |
'{{WRAPPER}} .jltma-comments-wrap .comment-respond' => 'width: {{SIZE}}{{UNIT}};', |
| 1495 |
], |
| 1496 |
] |
| 1497 |
); |
| 1498 |
|
| 1499 |
$this->add_responsive_control( |
| 1500 |
'jltma_comments_form_pading', |
| 1501 |
[ |
| 1502 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1503 |
'type' => Controls_Manager::DIMENSIONS, |
| 1504 |
'size_units' => ['px', 'em', '%'], |
| 1505 |
'separator' => 'before', |
| 1506 |
'selectors' => [ |
| 1507 |
'{{WRAPPER}} .jltma-comments-wrap .comment-respond' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1508 |
] |
| 1509 |
] |
| 1510 |
); |
| 1511 |
|
| 1512 |
$this->add_responsive_control( |
| 1513 |
'jltma_comments_form_margin', |
| 1514 |
[ |
| 1515 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1516 |
'type' => Controls_Manager::DIMENSIONS, |
| 1517 |
'size_units' => ['px', 'em', '%'], |
| 1518 |
'selectors' => [ |
| 1519 |
'{{WRAPPER}} .jltma-comments-wrap .comment-respond' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1520 |
] |
| 1521 |
] |
| 1522 |
); |
| 1523 |
|
| 1524 |
$this->add_group_control( |
| 1525 |
Group_Control_Border::get_type(), |
| 1526 |
[ |
| 1527 |
'name' => 'jltma_comments_form_border', |
| 1528 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap .comment-respond' |
| 1529 |
] |
| 1530 |
); |
| 1531 |
|
| 1532 |
$this->add_responsive_control( |
| 1533 |
'jltma_comments_form_border_radius', |
| 1534 |
[ |
| 1535 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1536 |
'type' => Controls_Manager::DIMENSIONS, |
| 1537 |
'size_units' => ['px', '%', 'em'], |
| 1538 |
'selectors' => [ |
| 1539 |
'{{WRAPPER}} .jltma-comments-wrap .comment-respond' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1540 |
] |
| 1541 |
] |
| 1542 |
); |
| 1543 |
|
| 1544 |
$this->add_group_control( |
| 1545 |
Group_Control_Box_Shadow::get_type(), |
| 1546 |
[ |
| 1547 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1548 |
'name' => 'jltma_comments_form_box_shadow', |
| 1549 |
'separator' => 'after', |
| 1550 |
'selector' => '{{WRAPPER}} .jltma-comments-wrap .comment-respond' |
| 1551 |
] |
| 1552 |
); |
| 1553 |
|
| 1554 |
$this->start_controls_tabs('jltma_comments_form_section_fields_tab'); |
| 1555 |
$this->start_controls_tab('jltma_comments_form_fields_name_tab', [ |
| 1556 |
'label' => esc_html__('Name', 'master-addons' ), |
| 1557 |
]); |
| 1558 |
|
| 1559 |
$this->add_control( |
| 1560 |
'jltma_comments_form_fields_name_width', |
| 1561 |
[ |
| 1562 |
'label' => esc_html__('Field Width', 'master-addons' ), |
| 1563 |
'type' => Controls_Manager::SLIDER, |
| 1564 |
'size_units' => ['px', 'em', '%'], |
| 1565 |
'range' => [ |
| 1566 |
'px' => [ |
| 1567 |
'min' => 10, |
| 1568 |
'max' => 1500, |
| 1569 |
], |
| 1570 |
'em' => [ |
| 1571 |
'min' => 1, |
| 1572 |
'max' => 80, |
| 1573 |
], |
| 1574 |
], |
| 1575 |
'default' => [ |
| 1576 |
'unit' => '%', |
| 1577 |
'size' => '100' |
| 1578 |
], |
| 1579 |
'selectors' => [ |
| 1580 |
'{{WRAPPER}} .jltma-comment-form .jltma-name' => 'width: {{SIZE}}{{UNIT}};', |
| 1581 |
], |
| 1582 |
] |
| 1583 |
); |
| 1584 |
|
| 1585 |
$this->add_responsive_control( |
| 1586 |
'jltma_comments_form_fields_name_pading', |
| 1587 |
[ |
| 1588 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1589 |
'type' => Controls_Manager::DIMENSIONS, |
| 1590 |
'size_units' => ['px', 'em', '%'], |
| 1591 |
'selectors' => [ |
| 1592 |
'{{WRAPPER}} .jltma-comment-form .jltma-name' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1593 |
] |
| 1594 |
] |
| 1595 |
); |
| 1596 |
|
| 1597 |
$this->add_responsive_control( |
| 1598 |
'jltma_comments_form_fields_name_margin', |
| 1599 |
[ |
| 1600 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1601 |
'type' => Controls_Manager::DIMENSIONS, |
| 1602 |
'size_units' => ['px', 'em', '%'], |
| 1603 |
'selectors' => [ |
| 1604 |
'{{WRAPPER}} .jltma-comment-form .jltma-name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1605 |
] |
| 1606 |
] |
| 1607 |
); |
| 1608 |
|
| 1609 |
$this->add_group_control( |
| 1610 |
Group_Control_Border::get_type(), |
| 1611 |
[ |
| 1612 |
'name' => 'jltma_comments_form_fields_name_border', |
| 1613 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-name #author' |
| 1614 |
] |
| 1615 |
); |
| 1616 |
|
| 1617 |
$this->add_responsive_control( |
| 1618 |
'jltma_comments_form_fields_name_border_radius', |
| 1619 |
[ |
| 1620 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1621 |
'type' => Controls_Manager::DIMENSIONS, |
| 1622 |
'size_units' => ['px', '%', 'em'], |
| 1623 |
'selectors' => [ |
| 1624 |
'{{WRAPPER}} .jltma-comment-form .jltma-name #author' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1625 |
] |
| 1626 |
] |
| 1627 |
); |
| 1628 |
|
| 1629 |
$this->add_group_control( |
| 1630 |
Group_Control_Box_Shadow::get_type(), |
| 1631 |
[ |
| 1632 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1633 |
'name' => 'jltma_comments_form_fields_name_box_shadow', |
| 1634 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-name #author' |
| 1635 |
] |
| 1636 |
); |
| 1637 |
|
| 1638 |
$this->end_controls_tab(); |
| 1639 |
|
| 1640 |
//Email |
| 1641 |
$this->start_controls_tab('jltma_comments_form_fields_email_tabs', [ |
| 1642 |
'label' => esc_html__('Email', 'master-addons' ) |
| 1643 |
]); |
| 1644 |
|
| 1645 |
$this->add_control( |
| 1646 |
'jltma_comments_form_fields_email_width', |
| 1647 |
[ |
| 1648 |
'label' => esc_html__('Field Width', 'master-addons' ), |
| 1649 |
'type' => Controls_Manager::SLIDER, |
| 1650 |
'size_units' => ['px', 'em', '%'], |
| 1651 |
'range' => [ |
| 1652 |
'px' => [ |
| 1653 |
'min' => 10, |
| 1654 |
'max' => 1500, |
| 1655 |
], |
| 1656 |
'em' => [ |
| 1657 |
'min' => 1, |
| 1658 |
'max' => 80, |
| 1659 |
], |
| 1660 |
], |
| 1661 |
'default' => [ |
| 1662 |
'unit' => '%', |
| 1663 |
'size' => '100' |
| 1664 |
], |
| 1665 |
'selectors' => [ |
| 1666 |
'{{WRAPPER}} .jltma-comment-form .jltma-email' => 'width: {{SIZE}}{{UNIT}};', |
| 1667 |
], |
| 1668 |
] |
| 1669 |
); |
| 1670 |
|
| 1671 |
$this->add_responsive_control( |
| 1672 |
'jltma_comments_form_fields_email_pading', |
| 1673 |
[ |
| 1674 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1675 |
'type' => Controls_Manager::DIMENSIONS, |
| 1676 |
'size_units' => ['px', 'em', '%'], |
| 1677 |
'selectors' => [ |
| 1678 |
'{{WRAPPER}} .jltma-comment-form .jltma-email' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1679 |
] |
| 1680 |
] |
| 1681 |
); |
| 1682 |
|
| 1683 |
$this->add_responsive_control( |
| 1684 |
'jltma_comments_form_fields_email_margin', |
| 1685 |
[ |
| 1686 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1687 |
'type' => Controls_Manager::DIMENSIONS, |
| 1688 |
'size_units' => ['px', 'em', '%'], |
| 1689 |
'selectors' => [ |
| 1690 |
'{{WRAPPER}} .jltma-comment-form .jltma-email' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1691 |
] |
| 1692 |
] |
| 1693 |
); |
| 1694 |
|
| 1695 |
$this->add_group_control( |
| 1696 |
Group_Control_Border::get_type(), |
| 1697 |
[ |
| 1698 |
'name' => 'jltma_comments_form_fields_email_border', |
| 1699 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-email #email' |
| 1700 |
] |
| 1701 |
); |
| 1702 |
|
| 1703 |
$this->add_responsive_control( |
| 1704 |
'jltma_comments_form_fields_email_border_radius', |
| 1705 |
[ |
| 1706 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1707 |
'type' => Controls_Manager::DIMENSIONS, |
| 1708 |
'size_units' => ['px', '%', 'em'], |
| 1709 |
'selectors' => [ |
| 1710 |
'{{WRAPPER}} .jltma-comment-form .jltma-email #email' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1711 |
] |
| 1712 |
] |
| 1713 |
); |
| 1714 |
|
| 1715 |
$this->add_group_control( |
| 1716 |
Group_Control_Box_Shadow::get_type(), |
| 1717 |
[ |
| 1718 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1719 |
'name' => 'jltma_comments_form_fields_email_box_shadow', |
| 1720 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-email #email' |
| 1721 |
] |
| 1722 |
); |
| 1723 |
|
| 1724 |
$this->end_controls_tab(); |
| 1725 |
|
| 1726 |
//Website |
| 1727 |
$this->start_controls_tab('jltma_comments_form_fields_url_tab', [ |
| 1728 |
'label' => esc_html__('Website', 'master-addons' ) |
| 1729 |
]); |
| 1730 |
|
| 1731 |
$this->add_control( |
| 1732 |
'jltma_comments_form_fields_url_width', |
| 1733 |
[ |
| 1734 |
'label' => esc_html__('Field Width', 'master-addons' ), |
| 1735 |
'type' => Controls_Manager::SLIDER, |
| 1736 |
'size_units' => ['px', 'em', '%'], |
| 1737 |
'range' => [ |
| 1738 |
'px' => [ |
| 1739 |
'min' => 10, |
| 1740 |
'max' => 1500, |
| 1741 |
], |
| 1742 |
'em' => [ |
| 1743 |
'min' => 1, |
| 1744 |
'max' => 80, |
| 1745 |
], |
| 1746 |
], |
| 1747 |
'default' => [ |
| 1748 |
'unit' => '%', |
| 1749 |
'size' => '100' |
| 1750 |
], |
| 1751 |
'selectors' => [ |
| 1752 |
'{{WRAPPER}} .jltma-comment-form .jltma-url' => 'width: {{SIZE}}{{UNIT}};', |
| 1753 |
], |
| 1754 |
] |
| 1755 |
); |
| 1756 |
|
| 1757 |
$this->add_responsive_control( |
| 1758 |
'jltma_comments_form_fields_url_pading', |
| 1759 |
[ |
| 1760 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1761 |
'type' => Controls_Manager::DIMENSIONS, |
| 1762 |
'size_units' => ['px', 'em', '%'], |
| 1763 |
'selectors' => [ |
| 1764 |
'{{WRAPPER}} .jltma-comment-form .jltma-url' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1765 |
] |
| 1766 |
] |
| 1767 |
); |
| 1768 |
|
| 1769 |
$this->add_responsive_control( |
| 1770 |
'jltma_comments_form_fields_url_margin', |
| 1771 |
[ |
| 1772 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1773 |
'type' => Controls_Manager::DIMENSIONS, |
| 1774 |
'size_units' => ['px', 'em', '%'], |
| 1775 |
'selectors' => [ |
| 1776 |
'{{WRAPPER}} .jltma-comment-form .jltma-url' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1777 |
] |
| 1778 |
] |
| 1779 |
); |
| 1780 |
|
| 1781 |
$this->add_group_control( |
| 1782 |
Group_Control_Border::get_type(), |
| 1783 |
[ |
| 1784 |
'name' => 'jltma_comments_form_fields_url_border', |
| 1785 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-url #url' |
| 1786 |
] |
| 1787 |
); |
| 1788 |
|
| 1789 |
$this->add_responsive_control( |
| 1790 |
'jltma_comments_form_fields_url_border_radius', |
| 1791 |
[ |
| 1792 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1793 |
'type' => Controls_Manager::DIMENSIONS, |
| 1794 |
'size_units' => ['px', '%', 'em'], |
| 1795 |
'selectors' => [ |
| 1796 |
'{{WRAPPER}} .jltma-comment-form .jltma-url #url' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1797 |
] |
| 1798 |
] |
| 1799 |
); |
| 1800 |
|
| 1801 |
$this->add_group_control( |
| 1802 |
Group_Control_Box_Shadow::get_type(), |
| 1803 |
[ |
| 1804 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1805 |
'name' => 'jltma_comments_form_fields_url_box_shadow', |
| 1806 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-url #url' |
| 1807 |
] |
| 1808 |
); |
| 1809 |
|
| 1810 |
$this->end_controls_tab(); |
| 1811 |
|
| 1812 |
//Comment Box |
| 1813 |
$this->start_controls_tab('jltma_comments_form_fields_textarea_tab', [ |
| 1814 |
'label' => esc_html__('Comment', 'master-addons' ) |
| 1815 |
]); |
| 1816 |
|
| 1817 |
$this->add_control( |
| 1818 |
'jltma_comments_form_fields_textarea_width', |
| 1819 |
[ |
| 1820 |
'label' => esc_html__('Field Width', 'master-addons' ), |
| 1821 |
'type' => Controls_Manager::SLIDER, |
| 1822 |
'size_units' => ['px', 'em', '%'], |
| 1823 |
'range' => [ |
| 1824 |
'px' => [ |
| 1825 |
'min' => 10, |
| 1826 |
'max' => 1500, |
| 1827 |
], |
| 1828 |
'em' => [ |
| 1829 |
'min' => 1, |
| 1830 |
'max' => 80, |
| 1831 |
], |
| 1832 |
], |
| 1833 |
'default' => [ |
| 1834 |
'unit' => '%', |
| 1835 |
'size' => '100' |
| 1836 |
], |
| 1837 |
'selectors' => [ |
| 1838 |
'{{WRAPPER}} .jltma-comment-form .jltma-comment' => 'width: {{SIZE}}{{UNIT}};', |
| 1839 |
], |
| 1840 |
] |
| 1841 |
); |
| 1842 |
|
| 1843 |
$this->add_responsive_control( |
| 1844 |
'jltma_comments_form_fields_textarea_pading', |
| 1845 |
[ |
| 1846 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1847 |
'type' => Controls_Manager::DIMENSIONS, |
| 1848 |
'size_units' => ['px', 'em', '%'], |
| 1849 |
'selectors' => [ |
| 1850 |
'{{WRAPPER}} .jltma-comment-form .jltma-comment' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1851 |
] |
| 1852 |
] |
| 1853 |
); |
| 1854 |
|
| 1855 |
$this->add_responsive_control( |
| 1856 |
'jltma_comments_form_fields_textarea_margin', |
| 1857 |
[ |
| 1858 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1859 |
'type' => Controls_Manager::DIMENSIONS, |
| 1860 |
'size_units' => ['px', 'em', '%'], |
| 1861 |
'selectors' => [ |
| 1862 |
'{{WRAPPER}} .jltma-comment-form .jltma-comment' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1863 |
] |
| 1864 |
] |
| 1865 |
); |
| 1866 |
|
| 1867 |
$this->add_group_control( |
| 1868 |
Group_Control_Border::get_type(), |
| 1869 |
[ |
| 1870 |
'name' => 'jltma_comments_form_fields_textarea_border', |
| 1871 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-comment #comment' |
| 1872 |
] |
| 1873 |
); |
| 1874 |
|
| 1875 |
$this->add_responsive_control( |
| 1876 |
'jltma_comments_form_fields_textarea_border_radius', |
| 1877 |
[ |
| 1878 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1879 |
'type' => Controls_Manager::DIMENSIONS, |
| 1880 |
'size_units' => ['px', '%', 'em'], |
| 1881 |
'selectors' => [ |
| 1882 |
'{{WRAPPER}} .jltma-comment-form .jltma-comment #comment' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1883 |
] |
| 1884 |
] |
| 1885 |
); |
| 1886 |
|
| 1887 |
$this->add_group_control( |
| 1888 |
Group_Control_Box_Shadow::get_type(), |
| 1889 |
[ |
| 1890 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1891 |
'name' => 'jltma_comments_form_fields_textarea_box_shadow', |
| 1892 |
'selector' => '{{WRAPPER}} .jltma-comment-form .jltma-comment #comment' |
| 1893 |
] |
| 1894 |
); |
| 1895 |
$this->end_controls_tab(); |
| 1896 |
|
| 1897 |
$this->end_controls_tabs(); |
| 1898 |
|
| 1899 |
$this->end_controls_section(); |
| 1900 |
|
| 1901 |
// Comment Submit |
| 1902 |
$this->start_controls_section( |
| 1903 |
'jltma_comments_submit_start', |
| 1904 |
[ |
| 1905 |
'label' => esc_html__('Comment Submit Button', 'master-addons' ), |
| 1906 |
'tab' => Controls_Manager::TAB_STYLE |
| 1907 |
] |
| 1908 |
); |
| 1909 |
|
| 1910 |
$this->add_group_control( |
| 1911 |
Group_Control_Background::get_type(), |
| 1912 |
[ |
| 1913 |
'name' => 'jltma_comments_submit_background', |
| 1914 |
'label' => esc_html__('Background', 'master-addons' ), |
| 1915 |
'types' => ['classic', 'gradient'], |
| 1916 |
'selector' => '{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit', |
| 1917 |
] |
| 1918 |
); |
| 1919 |
|
| 1920 |
$this->add_group_control( |
| 1921 |
Group_Control_Typography::get_type(), |
| 1922 |
[ |
| 1923 |
'name' => 'jltma_comments_submit_typography', |
| 1924 |
'selector' => '{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit', |
| 1925 |
'global' => [ |
| 1926 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1927 |
], |
| 1928 |
] |
| 1929 |
); |
| 1930 |
|
| 1931 |
$this->add_responsive_control( |
| 1932 |
'jltma_comments_submit_pading', |
| 1933 |
[ |
| 1934 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 1935 |
'type' => Controls_Manager::DIMENSIONS, |
| 1936 |
'size_units' => ['px', 'em', '%'], |
| 1937 |
'separator' => 'before', |
| 1938 |
'selectors' => [ |
| 1939 |
'{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1940 |
] |
| 1941 |
] |
| 1942 |
); |
| 1943 |
|
| 1944 |
$this->add_responsive_control( |
| 1945 |
'jltma_comments_submit_margin', |
| 1946 |
[ |
| 1947 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 1948 |
'type' => Controls_Manager::DIMENSIONS, |
| 1949 |
'size_units' => ['px', 'em', '%'], |
| 1950 |
'selectors' => [ |
| 1951 |
'{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1952 |
] |
| 1953 |
] |
| 1954 |
); |
| 1955 |
|
| 1956 |
$this->add_group_control( |
| 1957 |
Group_Control_Border::get_type(), |
| 1958 |
[ |
| 1959 |
'name' => 'jltma_comments_submit_border', |
| 1960 |
'selector' => '{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit' |
| 1961 |
] |
| 1962 |
); |
| 1963 |
|
| 1964 |
$this->add_responsive_control( |
| 1965 |
'jltma_comments_submit_border_radius', |
| 1966 |
[ |
| 1967 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 1968 |
'type' => Controls_Manager::DIMENSIONS, |
| 1969 |
'size_units' => ['px', '%', 'em'], |
| 1970 |
'selectors' => [ |
| 1971 |
'{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1972 |
] |
| 1973 |
] |
| 1974 |
); |
| 1975 |
|
| 1976 |
$this->add_group_control( |
| 1977 |
Group_Control_Box_Shadow::get_type(), |
| 1978 |
[ |
| 1979 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 1980 |
'name' => 'jltma_comments_submit_box_shadow', |
| 1981 |
'separator' => 'after', |
| 1982 |
'selector' => '{{WRAPPER}} .jltma-comment-style_one .jltma-form-submit input.jltma-comment-form-submit' |
| 1983 |
] |
| 1984 |
); |
| 1985 |
$this->end_controls_section(); |
| 1986 |
|
| 1987 |
/* |
| 1988 |
* MA Comments Pagination |
| 1989 |
*/ |
| 1990 |
$this->start_controls_section( |
| 1991 |
'jltma_comment_pagination_section_start', |
| 1992 |
[ |
| 1993 |
'label' => esc_html__('Pagination', 'master-addons' ), |
| 1994 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1995 |
'condition' => [ |
| 1996 |
'jltma_comment_pagination' => 'yes' |
| 1997 |
], |
| 1998 |
] |
| 1999 |
); |
| 2000 |
|
| 2001 |
$this->add_responsive_control( |
| 2002 |
'jltma_comment_pagination_pading', |
| 2003 |
[ |
| 2004 |
'label' => esc_html__('Padding', 'master-addons' ), |
| 2005 |
'type' => Controls_Manager::DIMENSIONS, |
| 2006 |
'size_units' => ['px', 'em', '%'], |
| 2007 |
'separator' => 'before', |
| 2008 |
'selectors' => [ |
| 2009 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2010 |
] |
| 2011 |
] |
| 2012 |
); |
| 2013 |
|
| 2014 |
$this->add_responsive_control( |
| 2015 |
'jltma_comment_pagination_margin', |
| 2016 |
[ |
| 2017 |
'label' => esc_html__('Margin', 'master-addons' ), |
| 2018 |
'type' => Controls_Manager::DIMENSIONS, |
| 2019 |
'size_units' => ['px', 'em', '%'], |
| 2020 |
'selectors' => [ |
| 2021 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2022 |
] |
| 2023 |
] |
| 2024 |
); |
| 2025 |
|
| 2026 |
$this->start_controls_tabs('jltma_comments_pagination_tabs'); |
| 2027 |
|
| 2028 |
$this->start_controls_tab('jltma_comments_pagination_tab', [ |
| 2029 |
'label' => esc_html__('Normal', 'master-addons' ) |
| 2030 |
]); |
| 2031 |
|
| 2032 |
$this->add_control( |
| 2033 |
'jltma_comments_pagination_btn_bg_color', |
| 2034 |
[ |
| 2035 |
'label' => esc_html__('BG Color', 'master-addons' ), |
| 2036 |
'type' => Controls_Manager::COLOR, |
| 2037 |
'global' => [ |
| 2038 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2039 |
], |
| 2040 |
'default' => '', |
| 2041 |
'selectors' => [ |
| 2042 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a' => 'background: {{VALUE}};' |
| 2043 |
] |
| 2044 |
] |
| 2045 |
); |
| 2046 |
|
| 2047 |
$this->add_control( |
| 2048 |
'jltma_comments_pagination_text_color', |
| 2049 |
[ |
| 2050 |
'label' => esc_html__('Text Color', 'master-addons' ), |
| 2051 |
'type' => Controls_Manager::COLOR, |
| 2052 |
'global' => [ |
| 2053 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2054 |
], |
| 2055 |
'default' => '', |
| 2056 |
'selectors' => [ |
| 2057 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a' => 'color: {{VALUE}};' |
| 2058 |
], |
| 2059 |
] |
| 2060 |
); |
| 2061 |
|
| 2062 |
$this->add_group_control( |
| 2063 |
Group_Control_Border::get_type(), |
| 2064 |
[ |
| 2065 |
'name' => 'jltma_comments_pagination_border', |
| 2066 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a' |
| 2067 |
] |
| 2068 |
); |
| 2069 |
|
| 2070 |
$this->add_responsive_control( |
| 2071 |
'jltma_comments_pagination_border_radius', |
| 2072 |
[ |
| 2073 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 2074 |
'type' => Controls_Manager::DIMENSIONS, |
| 2075 |
'size_units' => ['px', '%', 'em'], |
| 2076 |
'selectors' => [ |
| 2077 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2078 |
] |
| 2079 |
] |
| 2080 |
); |
| 2081 |
|
| 2082 |
$this->add_group_control( |
| 2083 |
Group_Control_Box_Shadow::get_type(), |
| 2084 |
[ |
| 2085 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 2086 |
'name' => 'jltma_comments_pagination_shadow', |
| 2087 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a' |
| 2088 |
] |
| 2089 |
); |
| 2090 |
|
| 2091 |
$this->end_controls_tab(); |
| 2092 |
|
| 2093 |
//Hover |
| 2094 |
$this->start_controls_tab('jltma_comments_pagination_hover_tabs', [ |
| 2095 |
'label' => esc_html__('Hover', 'master-addons' ) |
| 2096 |
]); |
| 2097 |
|
| 2098 |
$this->add_control( |
| 2099 |
'jltma_comments_pagination_hover_btn_bg_color', |
| 2100 |
[ |
| 2101 |
'label' => esc_html__('BG Color', 'master-addons' ), |
| 2102 |
'type' => Controls_Manager::COLOR, |
| 2103 |
'global' => [ |
| 2104 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2105 |
], |
| 2106 |
'default' => '', |
| 2107 |
'selectors' => [ |
| 2108 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a:hover' => 'background: {{VALUE}};' |
| 2109 |
] |
| 2110 |
] |
| 2111 |
); |
| 2112 |
|
| 2113 |
$this->add_control( |
| 2114 |
'jltma_comments_pagination_hover_text_color', |
| 2115 |
[ |
| 2116 |
'label' => esc_html__('Text Color', 'master-addons' ), |
| 2117 |
'type' => Controls_Manager::COLOR, |
| 2118 |
'global' => [ |
| 2119 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2120 |
], |
| 2121 |
'default' => '', |
| 2122 |
'selectors' => [ |
| 2123 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a:hover' => 'color: {{VALUE}};' |
| 2124 |
], |
| 2125 |
] |
| 2126 |
); |
| 2127 |
|
| 2128 |
$this->add_group_control( |
| 2129 |
Group_Control_Border::get_type(), |
| 2130 |
[ |
| 2131 |
'name' => 'jltma_comments_pagination_hover_border', |
| 2132 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a:hover' |
| 2133 |
] |
| 2134 |
); |
| 2135 |
|
| 2136 |
$this->add_responsive_control( |
| 2137 |
'jltma_comments_pagination_hover_border_radius', |
| 2138 |
[ |
| 2139 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 2140 |
'type' => Controls_Manager::DIMENSIONS, |
| 2141 |
'size_units' => ['px', '%', 'em'], |
| 2142 |
'selectors' => [ |
| 2143 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2144 |
] |
| 2145 |
] |
| 2146 |
); |
| 2147 |
|
| 2148 |
$this->add_group_control( |
| 2149 |
Group_Control_Box_Shadow::get_type(), |
| 2150 |
[ |
| 2151 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 2152 |
'name' => 'jltma_comments_pagination_hover_shadow', |
| 2153 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a:hover' |
| 2154 |
] |
| 2155 |
); |
| 2156 |
|
| 2157 |
$this->end_controls_tab(); |
| 2158 |
|
| 2159 |
//Active |
| 2160 |
$this->start_controls_tab('jltma_comments_pagination_active_tabs', [ |
| 2161 |
'label' => esc_html__('Active', 'master-addons' ) |
| 2162 |
]); |
| 2163 |
|
| 2164 |
$this->add_control( |
| 2165 |
'jltma_comments_pagination_active_btn_bg_color', |
| 2166 |
[ |
| 2167 |
'label' => esc_html__('BG Color', 'master-addons' ), |
| 2168 |
'type' => Controls_Manager::COLOR, |
| 2169 |
'global' => [ |
| 2170 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2171 |
], |
| 2172 |
'default' => '', |
| 2173 |
'selectors' => [ |
| 2174 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a.jltma-current-page' => 'background: {{VALUE}};' |
| 2175 |
] |
| 2176 |
] |
| 2177 |
); |
| 2178 |
|
| 2179 |
$this->add_control( |
| 2180 |
'jltma_comments_pagination_active_text_color', |
| 2181 |
[ |
| 2182 |
'label' => esc_html__('Text Color', 'master-addons' ), |
| 2183 |
'type' => Controls_Manager::COLOR, |
| 2184 |
'global' => [ |
| 2185 |
'default' => Global_Colors::COLOR_SECONDARY, |
| 2186 |
], |
| 2187 |
'default' => '', |
| 2188 |
'selectors' => [ |
| 2189 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a.jltma-current-page' => 'color: {{VALUE}};' |
| 2190 |
], |
| 2191 |
] |
| 2192 |
); |
| 2193 |
|
| 2194 |
$this->add_group_control( |
| 2195 |
Group_Control_Border::get_type(), |
| 2196 |
[ |
| 2197 |
'name' => 'jltma_comments_pagination_active_border', |
| 2198 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a.jltma-current-page' |
| 2199 |
] |
| 2200 |
); |
| 2201 |
|
| 2202 |
$this->add_responsive_control( |
| 2203 |
'jltma_comments_pagination_active_border_radius', |
| 2204 |
[ |
| 2205 |
'label' => esc_html__('Border Radius', 'master-addons' ), |
| 2206 |
'type' => Controls_Manager::DIMENSIONS, |
| 2207 |
'size_units' => ['px', '%', 'em'], |
| 2208 |
'selectors' => [ |
| 2209 |
'{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a.jltma-current-page' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 2210 |
] |
| 2211 |
] |
| 2212 |
); |
| 2213 |
|
| 2214 |
$this->add_group_control( |
| 2215 |
Group_Control_Box_Shadow::get_type(), |
| 2216 |
[ |
| 2217 |
'label' => esc_html__('Box Shadow', 'master-addons' ), |
| 2218 |
'name' => 'jltma_comments_pagination_active_shadow', |
| 2219 |
'selector' => '{{WRAPPER}} .jltma-comment-pagination-wrapper.jltma-page-number li a.jltma-current-page' |
| 2220 |
] |
| 2221 |
); |
| 2222 |
|
| 2223 |
$this->end_controls_tab(); |
| 2224 |
|
| 2225 |
$this->end_controls_tabs(); |
| 2226 |
|
| 2227 |
$this->end_controls_section(); |
| 2228 |
} |
| 2229 |
|
| 2230 |
public function jltma_comment_form($args = array(), $post_id = null) |
| 2231 |
{ |
| 2232 |
|
| 2233 |
if (null === $post_id) |
| 2234 |
$post_id = get_the_ID(); |
| 2235 |
|
| 2236 |
// Exit the function when comments for the post are closed. |
| 2237 |
if (!comments_open($post_id)) { |
| 2238 |
do_action('comment_form_comments_closed'); |
| 2239 |
return; |
| 2240 |
} |
| 2241 |
|
| 2242 |
$commenter = wp_get_current_commenter(); |
| 2243 |
$user = wp_get_current_user(); |
| 2244 |
$user_identity = $user->exists() ? $user->display_name : ''; |
| 2245 |
|
| 2246 |
$args = wp_parse_args($args); |
| 2247 |
if (!isset($args['format'])) |
| 2248 |
$args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml'; |
| 2249 |
|
| 2250 |
$req = get_option('require_name_email'); |
| 2251 |
|
| 2252 |
$aria_req = ($req ? " aria-required='true'" : ''); |
| 2253 |
$html_req = ($req ? " required='required'" : ''); |
| 2254 |
$html5 = 'html5' === $args['format']; |
| 2255 |
|
| 2256 |
$fields = array( |
| 2257 |
'author' => '<p class="jltma-comment-form-author">' . '<label for="author">' . esc_html__('Name') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . |
| 2258 |
'<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" maxlength="245"' . esc_attr($aria_req) . esc_attr( |
| 2259 |
$html_req |
| 2260 |
) . ' /></p>', |
| 2261 |
|
| 2262 |
'email' => '<p class="jltma-comment-form-email"><label for="email">' . esc_html__('Email') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . |
| 2263 |
'<input id="email" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30" maxlength="100" aria-describedby="email-notes"' . esc_attr($aria_req) . esc_attr($html_req) . ' /></p>', |
| 2264 |
|
| 2265 |
'url' => '<p class="jltma-comment-form-url"><label for="url">' . esc_html__('Website') . '</label> ' . |
| 2266 |
'<input id="url" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_url($commenter['comment_author_url']) . '" size="30" maxlength="200" /></p>', |
| 2267 |
); |
| 2268 |
|
| 2269 |
$required_text = sprintf(' ' . esc_html__('Required fields are marked %s'), '<span class="required">*</span>'); |
| 2270 |
|
| 2271 |
$fields = apply_filters('comment_form_default_fields', $fields); |
| 2272 |
|
| 2273 |
$defaults = array( |
| 2274 |
'fields' => $fields, |
| 2275 |
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x('Comment', 'noun') . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>', |
| 2276 |
'must_log_in' => '<p class="must-log-in">' . sprintf( |
| 2277 |
esc_html__('You must be <a href="%s">logged in</a> to post a comment.'), |
| 2278 |
wp_login_url(apply_filters('the_permalink', get_permalink($post_id), $post_id)) |
| 2279 |
) . '</p>', |
| 2280 |
'logged_in_as' => '<p class="logged-in-as">' . sprintf( |
| 2281 |
esc_html__('<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>'), |
| 2282 |
get_edit_user_link(), |
| 2283 |
esc_attr(sprintf(__('Logged in as %s. Edit your profile.'), $user_identity)), |
| 2284 |
$user_identity, |
| 2285 |
wp_logout_url(apply_filters('the_permalink', get_permalink($post_id), $post_id)) |
| 2286 |
) . '</p>', |
| 2287 |
'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . esc_html__('Your email address will not be published.') . '</span>' . ($req ? $required_text : '') . '</p>', |
| 2288 |
'comment_notes_after' => '', |
| 2289 |
'action' => site_url('/wp-comments-post.php'), |
| 2290 |
'id_form' => 'commentform', |
| 2291 |
'id_submit' => 'submit', |
| 2292 |
'class_form' => 'comment-form', |
| 2293 |
'class_submit' => 'submit', |
| 2294 |
'name_submit' => 'submit', |
| 2295 |
'title_reply' => esc_html__('Leave a Reply', 'master-addons' ), |
| 2296 |
'title_reply_to' => esc_html__('Leave a Reply to %s'), |
| 2297 |
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title clearfix">', |
| 2298 |
'title_reply_after' => '</h3>', |
| 2299 |
'cancel_reply_before' => ' <small>', |
| 2300 |
'cancel_reply_after' => '</small>', |
| 2301 |
'cancel_reply_link' => esc_html__('Cancel reply', 'master-addons' ), |
| 2302 |
'label_submit' => esc_html__('Post Comment', 'master-addons' ), |
| 2303 |
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', |
| 2304 |
'submit_field' => '<p class="form-submit">%1$s %2$s</p>', |
| 2305 |
'format' => 'xhtml', |
| 2306 |
); |
| 2307 |
$args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults)); |
| 2308 |
|
| 2309 |
$args = array_merge($defaults, $args); |
| 2310 |
|
| 2311 |
do_action('comment_form_before'); |
| 2312 |
|
| 2313 |
?> |
| 2314 |
|
| 2315 |
<div id="respond" class="comment-respond"> |
| 2316 |
<?php |
| 2317 |
echo wp_kses_post($args['title_reply_before']); |
| 2318 |
|
| 2319 |
comment_form_title($args['title_reply'], $args['title_reply_to']); |
| 2320 |
|
| 2321 |
echo wp_kses_post($args['cancel_reply_before']); |
| 2322 |
|
| 2323 |
cancel_comment_reply_link($args['cancel_reply_link']); |
| 2324 |
|
| 2325 |
echo wp_kses_post($args['cancel_reply_after']); |
| 2326 |
|
| 2327 |
echo wp_kses_post($args['title_reply_after']); |
| 2328 |
|
| 2329 |
if (get_option('comment_registration') && !is_user_logged_in()) : |
| 2330 |
echo wp_kses_post($args['must_log_in']); |
| 2331 |
do_action('comment_form_must_log_in_after'); |
| 2332 |
else : |
| 2333 |
?> |
| 2334 |
<form action="<?php echo esc_url($args['action']); ?>" method="post" id="<?php echo esc_attr($args['id_form']); ?>" class="<?php echo esc_attr($args['class_form']); ?>" <?php echo esc_attr($html5) ? ' novalidate' : ''; ?>> |
| 2335 |
<?php |
| 2336 |
do_action('comment_form_top'); |
| 2337 |
|
| 2338 |
if (is_user_logged_in()) : |
| 2339 |
|
| 2340 |
echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); |
| 2341 |
do_action('comment_form_logged_in_after', $commenter, $user_identity); |
| 2342 |
|
| 2343 |
else : |
| 2344 |
|
| 2345 |
echo wp_kses_post($args['comment_notes_before']); |
| 2346 |
|
| 2347 |
endif; |
| 2348 |
|
| 2349 |
$comment_fields = array('comment' => $args['comment_field']) + (array) $args['fields']; |
| 2350 |
|
| 2351 |
$comment_fields = apply_filters('comment_form_fields', $comment_fields); |
| 2352 |
|
| 2353 |
$comment_field_keys = array_diff(array_keys($comment_fields), array('comment')); |
| 2354 |
|
| 2355 |
$first_field = reset($comment_field_keys); |
| 2356 |
|
| 2357 |
$last_field = end($comment_field_keys); |
| 2358 |
|
| 2359 |
foreach ($comment_fields as $name => $field) { |
| 2360 |
|
| 2361 |
if (!is_user_logged_in()) { |
| 2362 |
|
| 2363 |
if ($first_field === $name) { |
| 2364 |
do_action('comment_form_before_fields'); |
| 2365 |
} |
| 2366 |
|
| 2367 |
echo apply_filters("comment_form_field_{$name}", $field) . "\n"; |
| 2368 |
|
| 2369 |
if ($last_field === $name) { |
| 2370 |
do_action('comment_form_after_fields'); |
| 2371 |
} |
| 2372 |
} elseif (is_user_logged_in() && Comments_Builder::jltma_comment_elementor_preview_mode()) { |
| 2373 |
|
| 2374 |
do_action('comment_form_before_fields'); |
| 2375 |
|
| 2376 |
echo apply_filters("comment_form_field_{$name}", $field) . "\n"; |
| 2377 |
|
| 2378 |
if ($last_field === $name) { |
| 2379 |
do_action('comment_form_after_fields'); |
| 2380 |
} |
| 2381 |
} else { |
| 2382 |
|
| 2383 |
if ($first_field === $name) { |
| 2384 |
do_action('comment_form_before_fields'); |
| 2385 |
} |
| 2386 |
if ($name != 'name' && $name != 'email' && $name != 'url') { |
| 2387 |
echo apply_filters("comment_form_field_{$name}", $field) . "\n"; |
| 2388 |
} |
| 2389 |
|
| 2390 |
if ($last_field === $name) { |
| 2391 |
do_action('comment_form_after_fields'); |
| 2392 |
} |
| 2393 |
} |
| 2394 |
} |
| 2395 |
|
| 2396 |
echo wp_kses_post($args['comment_notes_after']); |
| 2397 |
|
| 2398 |
$submit_button = sprintf( |
| 2399 |
$args['submit_button'], |
| 2400 |
esc_attr($args['name_submit']), |
| 2401 |
esc_attr($args['id_submit']), |
| 2402 |
esc_attr($args['class_submit']), |
| 2403 |
esc_attr($args['label_submit']) |
| 2404 |
); |
| 2405 |
$submit_button = apply_filters('comment_form_submit_button', $submit_button, $args); |
| 2406 |
|
| 2407 |
$submit_field = sprintf( |
| 2408 |
$args['submit_field'], |
| 2409 |
$submit_button, |
| 2410 |
get_comment_id_fields($post_id) |
| 2411 |
); |
| 2412 |
echo apply_filters('comment_form_submit_field', $submit_field, $args); |
| 2413 |
do_action('jltma_comment_form', $post_id); |
| 2414 |
do_action('comment_form', $post_id); // required for _wp_unfiltered_html_comment_disabled nonce |
| 2415 |
?> |
| 2416 |
</form> |
| 2417 |
<?php endif; ?> |
| 2418 |
</div> |
| 2419 |
|
| 2420 |
<?php |
| 2421 |
} |
| 2422 |
|
| 2423 |
public function jltma_frontend_form_build() |
| 2424 |
{ |
| 2425 |
$settings = $this->get_settings_for_display(); |
| 2426 |
|
| 2427 |
if (comments_open()) { |
| 2428 |
$commenter = wp_get_current_commenter(); |
| 2429 |
$user = wp_get_current_user(); |
| 2430 |
$user_identity = $user->exists() ? $user->display_name : ''; |
| 2431 |
|
| 2432 |
$fields = ''; |
| 2433 |
|
| 2434 |
// Name Field |
| 2435 |
$jltma_cf_name_required = esc_html__('(Required)', 'master-addons' ); |
| 2436 |
|
| 2437 |
$jltma_cf_name_label_container = ""; |
| 2438 |
if ($settings['jltma_comment_fields_name_label_display'] == "show") { |
| 2439 |
$jltma_cf_name_label = ($settings['jltma_comment_fields_name_label'] != '') ? esc_attr($settings['jltma_comment_fields_name_label']) : ''; |
| 2440 |
|
| 2441 |
if ($jltma_cf_name_label) { |
| 2442 |
$jltma_cf_name_label_container = '<div class="jltma-name-div"> |
| 2443 |
<label>' . esc_attr($jltma_cf_name_label) . '</label> |
| 2444 |
</div>'; |
| 2445 |
} |
| 2446 |
} |
| 2447 |
|
| 2448 |
$jltma_cf_name_placeholder = ($settings['jltma_comment_fields_name_label_placeholder'] != '') ? esc_attr($settings['jltma_comment_fields_name_label_placeholder']) : ''; |
| 2449 |
|
| 2450 |
$jltma_cf_name_style = ""; |
| 2451 |
|
| 2452 |
$jltma_cf_name_ft = (isset($settings['jltma_field_type']) && $settings['jltma_field_type']) ? esc_attr($settings['jltma_field_type']) : "text"; |
| 2453 |
|
| 2454 |
$fields .= '<div class="jltma-name-value-div jltma-name"> |
| 2455 |
' . $jltma_cf_name_label_container . ' |
| 2456 |
<div class="jltma-value-div"> |
| 2457 |
<input class="form-control" type="' . esc_attr($jltma_cf_name_ft) . '" name="author" id="author" value="" placeholder="' . esc_attr($jltma_cf_name_placeholder) . '" ' . esc_attr($jltma_cf_name_style) . '/> |
| 2458 |
</div> |
| 2459 |
</div>'; |
| 2460 |
|
| 2461 |
// Email Field |
| 2462 |
$jltma_cf_email_required = esc_html__('(Required)', 'master-addons' ); |
| 2463 |
|
| 2464 |
$jltma_cf_email_label_container = ""; |
| 2465 |
if ($settings['jltma_comment_fields_email_label_display'] == "show") { |
| 2466 |
|
| 2467 |
$jltma_cf_email_label = ($settings['jltma_comment_fields_email_label'] != '') ? esc_attr($settings['jltma_comment_fields_email_label']) : ''; |
| 2468 |
|
| 2469 |
if ($jltma_cf_email_label) { |
| 2470 |
$jltma_cf_email_label_container = '<div class="jltma-email-div"> |
| 2471 |
<label>' . esc_attr($jltma_cf_email_label) . '</label> |
| 2472 |
</div>'; |
| 2473 |
} |
| 2474 |
} |
| 2475 |
|
| 2476 |
$jltma_cf_email_placeholder = ($settings['jltma_comment_fields_email_label_placeholder'] != '') ? esc_attr($settings['jltma_comment_fields_email_label_placeholder']) : ''; |
| 2477 |
|
| 2478 |
$jltma_cf_email_style = ""; |
| 2479 |
|
| 2480 |
$jltma_cf_email_ft = (isset($settings['jltma_field_type']) && $settings['jltma_field_type']) ? esc_attr($settings['jltma_field_type']) : "email"; |
| 2481 |
|
| 2482 |
$fields .= '<div class="jltma-email-value-div jltma-email"> |
| 2483 |
' . $jltma_cf_email_label_container . ' |
| 2484 |
<div class="jltma-value-div"> |
| 2485 |
<input class="form-control" type="' . esc_attr($jltma_cf_email_ft) . '" id="email" name="email" value="" placeholder="' . esc_attr($jltma_cf_email_placeholder) . '" ' . esc_attr($jltma_cf_email_style) . '/> |
| 2486 |
</div> |
| 2487 |
</div>'; |
| 2488 |
|
| 2489 |
// URL Field |
| 2490 |
$jltma_cf_url_required = esc_html__('(Required)', 'master-addons' ); |
| 2491 |
|
| 2492 |
if ($settings['jltma_comment_fields_url_display'] == 'show') { |
| 2493 |
$jltma_cf_url_label_container = ""; |
| 2494 |
if ($settings['jltma_comment_fields_url_label_display'] == "show") { |
| 2495 |
$jltma_cf_url_label = ($settings['jltma_comment_fields_url_label'] != '') ? esc_attr($settings['jltma_comment_fields_url_label']) : ''; |
| 2496 |
|
| 2497 |
if ($jltma_cf_url_label) { |
| 2498 |
$jltma_cf_url_label_container = '<div class="jltma-url-div"> |
| 2499 |
<label>' . esc_html($jltma_cf_url_label) . '</label> |
| 2500 |
</div>'; |
| 2501 |
} |
| 2502 |
} |
| 2503 |
|
| 2504 |
$jltma_cf_url_placeholder = ($settings['jltma_comment_fields_url_label_placeholder'] != '') ? esc_attr($settings['jltma_comment_fields_url_label_placeholder']) : ''; |
| 2505 |
|
| 2506 |
$jltma_cf_url_style = ""; |
| 2507 |
|
| 2508 |
$jltma_cf_url_ft = (isset($settings['jltma_field_type']) && $settings['jltma_field_type']) ? esc_attr($settings['jltma_field_type']) : "text"; |
| 2509 |
|
| 2510 |
$fields .= '<div class="jltma-url-value-div jltma-url"> |
| 2511 |
' . $jltma_cf_url_label_container . ' |
| 2512 |
<div class="jltma-value-div"> |
| 2513 |
<input class="form-control" type="' . esc_attr($jltma_cf_url_ft) . '" id="url" name="url" value="" placeholder="' . esc_attr($jltma_cf_url_placeholder) . '" ' . esc_attr($jltma_cf_url_style) . '/> |
| 2514 |
</div> |
| 2515 |
</div>'; |
| 2516 |
} |
| 2517 |
|
| 2518 |
// Textarea Field |
| 2519 |
$jltma_ta_required = esc_html__('(Required)', 'master-addons' ); |
| 2520 |
|
| 2521 |
$jltma_ta_label_container = ""; |
| 2522 |
if ($settings['jltma_comment_fields_textarea_label_display'] == "show") { |
| 2523 |
|
| 2524 |
$jltma_ta_label = ($settings['jltma_comment_fields_textarea_label'] != '') ? esc_attr($settings['jltma_comment_fields_textarea_label']) : ''; |
| 2525 |
|
| 2526 |
if ($jltma_ta_label) { |
| 2527 |
$jltma_ta_label_container = '<div class="jltma-title-div"> |
| 2528 |
<label>' . esc_html($jltma_ta_label) . '</label> |
| 2529 |
</div>'; |
| 2530 |
} |
| 2531 |
} |
| 2532 |
|
| 2533 |
// Notice |
| 2534 |
$jltma_ta_notice_container = ""; |
| 2535 |
if ($settings['jltma_comment_fields_textarea_notice'] == "show") { |
| 2536 |
|
| 2537 |
$jltma_ta_label = ($settings['jltma_comment_fields_textarea_label'] != '') ? esc_attr($settings['jltma_comment_fields_textarea_label']) : ''; |
| 2538 |
$jltma_ta_notice_content = ($settings['jltma_comment_fields_textarea_notice_content'] != "") ? $settings['jltma_comment_fields_textarea_notice_content'] : ''; |
| 2539 |
$jltma_ta_notice_align = ($settings['jltma_comment_fields_textarea_notice_align'] != "") ? $settings['jltma_comment_fields_textarea_notice_align'] : 'right'; |
| 2540 |
|
| 2541 |
$jltma_ta_notice_container = '<div class="field-description"> |
| 2542 |
<span class = "jltma-comment-description_tooltip ' . esc_attr($jltma_ta_notice_align) . '">' . esc_html($jltma_ta_notice_content) . '</span> |
| 2543 |
</div>'; |
| 2544 |
} |
| 2545 |
|
| 2546 |
$jltma_ta_placeholder = ($settings['jltma_comment_fields_textarea_label_placeholder'] != '') ? esc_attr($settings['jltma_comment_fields_textarea_label_placeholder']) : ''; |
| 2547 |
|
| 2548 |
$jltma_ta_style = ""; |
| 2549 |
|
| 2550 |
$jltma_cta_ft = (isset($settings['jltma_field_type'])) ? $settings['jltma_field_type'] : ""; |
| 2551 |
|
| 2552 |
$comment_ta_field = '<div class="jltma-title-value-div jltma-comment"> |
| 2553 |
' . $jltma_ta_label_container . ' |
| 2554 |
<div class = "jltma-value-div"> |
| 2555 |
<textarea class = "form-control" name = "comment" id = "comment" cols = "45" rows = "8" class = "textarea-comment" placeholder = "' . esc_attr($jltma_ta_placeholder) . '" ' . esc_attr($jltma_cta_ft) . '></textarea> |
| 2556 |
</div>' . esc_html($jltma_ta_notice_container) . '</div>'; |
| 2557 |
|
| 2558 |
$comment_notes_before = ($settings['jltma_comment_before_notes'] != '') ? esc_attr($settings['jltma_comment_before_notes']) : ""; |
| 2559 |
|
| 2560 |
$comment_notes_after = (isset($settings['jltma_comment_after_notes']) && $settings['jltma_comment_after_notes'] != '') ? esc_attr($settings['jltma_comment_after_notes']) : ""; |
| 2561 |
|
| 2562 |
$title_reply = (isset($settings['jltma_comment_label']) && $settings['jltma_comment_label'] != '') ? esc_attr($settings['jltma_comment_label']) : esc_html__('Leave a Comment', 'master-addons' ); |
| 2563 |
|
| 2564 |
$title_reply_to = (isset($settings['jltma_comment_reply_label']) && $settings['jltma_comment_reply_label'] != '') ? esc_attr($settings['jltma_comment_reply_label']) : esc_html__('Leave a Reply', 'master-addons' ); |
| 2565 |
|
| 2566 |
$cancel_reply_link = (isset($settings['jltma_comment_cancel_reply_label']) && $settings['jltma_comment_cancel_reply_label'] != '') ? esc_attr($settings['jltma_comment_cancel_reply_label']) : esc_html__('Cancel Reply', 'master-addons' ); |
| 2567 |
|
| 2568 |
$label_submit = (isset($settings['jltma_comment_form_submit_label']) && $settings['jltma_comment_form_submit_label'] != '') ? esc_attr($settings['jltma_comment_form_submit_label']) : esc_html__('Post Comment', 'master-addons' ); |
| 2569 |
|
| 2570 |
// API Settings |
| 2571 |
$jltma_api_settings = get_option('jltma_api_save_settings'); |
| 2572 |
$submit_field = ''; |
| 2573 |
if (!is_user_logged_in()) { |
| 2574 |
if (isset($settings['jltma_comment_spam_protection']) && $settings['jltma_comment_spam_protection'] == "yes") { |
| 2575 |
$submit_field .= '<div class="g-recaptcha" data-sitekey="' . esc_attr($jltma_api_settings['recaptcha_site_key']) . '" data-badge="inline" render="explicit" style="padding-top:30px;"></div>'; |
| 2576 |
} |
| 2577 |
} |
| 2578 |
|
| 2579 |
if (is_user_logged_in() && Comments_Builder::jltma_comment_elementor_preview_mode()) { |
| 2580 |
echo esc_html__('Check Frontend Comment Form for reCaptcha', 'master-addons' ); |
| 2581 |
} |
| 2582 |
|
| 2583 |
$submit_field .= '<div class="jltma-form-submit">%1$s %2$s</div>'; |
| 2584 |
|
| 2585 |
$comments_args = array( |
| 2586 |
'fields' => apply_filters('comment_form_default_fields', $fields), |
| 2587 |
'comment_field' => '', |
| 2588 |
'title_reply' => $title_reply, |
| 2589 |
'title_reply_to' => $title_reply_to, |
| 2590 |
|
| 2591 |
'must_log_in' => '<p class="must-log-in">' . /* translators: 1: Anchor tag start, 2: Anchor tag end. */ sprintf(esc_html__('You must be %1$slogged in%2$s to post a comment.', 'master-addons' ), '<a href="' . wp_login_url(apply_filters('the_permalink', get_permalink())) . '">', '</a>') . '</p>', |
| 2592 |
|
| 2593 |
'logged_in_as' => '<p class="logged-in-as">' . /* translators: 1: Profile link, 2: Log Out Link. */ sprintf(esc_html__('Logged in as %1$s. %2$sLog out »%3$s', 'master-addons' ), '<a href="' . esc_url(admin_url('profile.php')) . '">' . esc_html($user_identity) . '</a>', '<a href="' . wp_logout_url(apply_filters('the_permalink', get_permalink())) . '" title="' . esc_html__('Log out of this account', 'master-addons' ) . '">', '</a>') . '</p>', |
| 2594 |
|
| 2595 |
'comment_notes_before' => $comment_notes_before, |
| 2596 |
'comment_notes_after' => $comment_notes_after, |
| 2597 |
'cancel_reply_link' => $cancel_reply_link, |
| 2598 |
'id_submit' => 'jltma-comment-submit', |
| 2599 |
'class_submit' => 'jltma-comment-form-submit', |
| 2600 |
'label_submit' => $label_submit, |
| 2601 |
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', |
| 2602 |
// 'submit_field' => '<div class="jltma-form-submit">%1$s %2$s</div>', |
| 2603 |
'submit_field' => $submit_field, |
| 2604 |
'id_form' => 'jltma-commentform', |
| 2605 |
'id_submit' => 'jltma-submit', |
| 2606 |
'class_form' => 'jltma-comment-form clearfix', |
| 2607 |
'comment_field' => $comment_ta_field |
| 2608 |
); |
| 2609 |
|
| 2610 |
$this->jltma_comment_form($comments_args); |
| 2611 |
} |
| 2612 |
} |
| 2613 |
|
| 2614 |
public function jltma_comment_listing_inner_template() |
| 2615 |
{ |
| 2616 |
|
| 2617 |
global $wpdb, $post; |
| 2618 |
|
| 2619 |
$settings = $this->get_settings_for_display(); |
| 2620 |
|
| 2621 |
$page_number = empty($page_number) ? 1 : $page_number; |
| 2622 |
|
| 2623 |
$template = ($settings['jltma_comment_style_preset'] != "") ? esc_attr($settings['jltma_comment_style_preset']) : 'style_one'; |
| 2624 |
|
| 2625 |
$pagination = ($settings['jltma_comment_pagination'] == "yes") ? esc_attr($settings['jltma_comment_pagination']) : ''; |
| 2626 |
|
| 2627 |
$items_per_page = isset($settings['jltma_comment_pagination_items']['size']) ? esc_attr($settings['jltma_comment_pagination_items']['size']) : '10'; |
| 2628 |
|
| 2629 |
$pagination_type = 'page_number'; |
| 2630 |
$sort_type = 'default'; |
| 2631 |
$post_id = $post->ID; |
| 2632 |
?> |
| 2633 |
|
| 2634 |
<input type="hidden" id="jltma-current-post-id" value="<?php echo (int) $post_id; ?>"> |
| 2635 |
|
| 2636 |
<div class="jltma-comment-list-inner"> |
| 2637 |
<?php |
| 2638 |
$db_table_name = $wpdb->prefix . "comments"; |
| 2639 |
$comment_listing = Comments_Builder::jltma_recursive_array_builder( |
| 2640 |
$db_table_name = $wpdb->prefix . "comments", |
| 2641 |
$parent = 0, |
| 2642 |
$parent_child = true, |
| 2643 |
$post_id, |
| 2644 |
$sort_type, |
| 2645 |
$pagination, |
| 2646 |
$items_per_page, |
| 2647 |
$pagination_type, |
| 2648 |
$page_number |
| 2649 |
); |
| 2650 |
?> |
| 2651 |
<div class="jltma-comment-listing-wrapper"> |
| 2652 |
<?php |
| 2653 |
$class = 'jltma-comment-list'; |
| 2654 |
$css = ""; |
| 2655 |
$child = 0; |
| 2656 |
$jltma_list_comments = new Comments_Builder(); |
| 2657 |
$jltma_list_comments->jltma_list_comments($comment_listing, $class, $css, $template, $settings); |
| 2658 |
?> |
| 2659 |
</div> |
| 2660 |
</div> |
| 2661 |
|
| 2662 |
<?php |
| 2663 |
if ($settings['jltma_comment_pagination'] == 'yes') { |
| 2664 |
|
| 2665 |
$this->jltma_comment_pagination_wrapper($comment_listing, $post_id, $settings); |
| 2666 |
} |
| 2667 |
?> |
| 2668 |
|
| 2669 |
<?php } |
| 2670 |
|
| 2671 |
public function jltma_comment_pagination_wrapper($comment_listing, $post_id, $settings) |
| 2672 |
{ |
| 2673 |
global $post; |
| 2674 |
|
| 2675 |
$page_number = empty($page_number) ? 1 : $page_number; |
| 2676 |
$items_per_page = $settings['jltma_comment_pagination_items']['size']; |
| 2677 |
$all_comments_approved = Comments_Builder::parent_comment_counter($post_id); |
| 2678 |
|
| 2679 |
$total = ceil($all_comments_approved / $items_per_page); |
| 2680 |
|
| 2681 |
$pagination_type = 'page-number'; |
| 2682 |
|
| 2683 |
$jltma_comment_settings = new Comments_Builder(); |
| 2684 |
$jltma_comment_settings->jltma_comment_pagination($settings); |
| 2685 |
|
| 2686 |
?> |
| 2687 |
|
| 2688 |
<div class="jltma-comment-pagination-wrapper jltma-pagination-not-demo jltma-<?php echo esc_attr($pagination_type); ?> "> |
| 2689 |
<?php |
| 2690 |
?> |
| 2691 |
<ul> |
| 2692 |
<?php |
| 2693 |
for ($i = 1; $i <= $total - 1; $i++) { |
| 2694 |
?> |
| 2695 |
<li> |
| 2696 |
<a href="javascript:void(0);" data-total-page="<?php echo esc_attr($total); ?>" id="jltma-page-number" data-page-number="<?php echo esc_attr($i); ?>" data-pagination-type="page-number" class="<?php echo ($i == 1) ? 'jltma-current-page' : ''; ?> jltma-page-link"> |
| 2697 |
<?php echo esc_attr($i); ?> |
| 2698 |
</a> |
| 2699 |
</li> |
| 2700 |
<?php |
| 2701 |
} |
| 2702 |
if ($total > 1) { |
| 2703 |
?> |
| 2704 |
<li class="jltma-next-page-wrap"><a href="javascript:void(0);" data-total-page="<?php echo esc_attr($total); ?>" data-page-number="2" data-pagination-type="page-number" class="jltma-next-page"><i class="fa fa-angle-right"></i></a></li> |
| 2705 |
<?php } ?> |
| 2706 |
</ul> |
| 2707 |
<img src="<?php echo \JLTMA_URL . '/assets/images/ajax-loader.gif' ?>" class="jltma-page-number-loader" style="display:none;"> |
| 2708 |
<?php |
| 2709 |
?> |
| 2710 |
</div> |
| 2711 |
|
| 2712 |
<?php } |
| 2713 |
|
| 2714 |
public function jltma_comment_list_template() |
| 2715 |
{ |
| 2716 |
$settings = $this->get_settings_for_display(); |
| 2717 |
|
| 2718 |
$page_number = empty($page_number) ? 1 : $page_number; |
| 2719 |
$template = ($settings['jltma_comment_style_preset'] != "") ? esc_attr($settings['jltma_comment_style_preset']) : 'style_one'; |
| 2720 |
$pagination = ($settings['jltma_comment_pagination'] == "yes") ? esc_attr($settings['jltma_comment_pagination']) : ''; |
| 2721 |
|
| 2722 |
$items_per_page = isset($settings['jltma_comment_pagination_items']['size']) ? esc_attr($settings['jltma_comment_pagination_items']['size']) : '10'; |
| 2723 |
$pagination_type = 'page_number'; |
| 2724 |
?> |
| 2725 |
|
| 2726 |
<div class="jltma-comment-listing-wrap" id="jltma-comment-listing-wrap"> |
| 2727 |
|
| 2728 |
<?php |
| 2729 |
// Demo Contents for Elementor Template Preivew |
| 2730 |
if (is_user_logged_in() && Comments_Builder::jltma_comment_elementor_preview_mode()) { |
| 2731 |
echo '<h5 class="alert alert-info">These Comments Data\'s are only for Live Preview on Elementor Backend</h5><br>'; |
| 2732 |
} |
| 2733 |
|
| 2734 |
if (isset($settings['jltma_comment_total_number']) && $settings['jltma_comment_total_number'] == 'show') { |
| 2735 |
|
| 2736 |
// Demo Contents for Elementor Template Preivew |
| 2737 |
if (is_user_logged_in() && Comments_Builder::jltma_comment_elementor_preview_mode()) { |
| 2738 |
|
| 2739 |
if ($settings['jltma_comment_plural_comment_text'] != "") { |
| 2740 |
$backend_comment_text = $settings['jltma_comment_plural_comment_text']; |
| 2741 |
} elseif ($settings['jltma_comment_single_comment_text'] != "") { |
| 2742 |
$backend_comment_text = $settings['jltma_comment_single_comment_text']; |
| 2743 |
} elseif ($settings['jltma_comment_plural_comment_text'] != "") { |
| 2744 |
$backend_comment_text = $settings['jltma_comment_plural_comment_text']; |
| 2745 |
} else { |
| 2746 |
$backend_comment_text = $settings['jltma_comment_no_comment_text']; |
| 2747 |
} |
| 2748 |
echo "<h3 class='jltma-comments-title'>"; |
| 2749 |
echo '5 ' . esc_attr($backend_comment_text) . ' on ' . get_the_title(); |
| 2750 |
echo "</h3>"; |
| 2751 |
} else { |
| 2752 |
|
| 2753 |
$no_comment = $settings['jltma_comment_no_comment_text']; |
| 2754 |
$one_comment = $settings['jltma_comment_single_comment_text']; |
| 2755 |
$plural_comment = $settings['jltma_comment_plural_comment_text']; |
| 2756 |
|
| 2757 |
echo "<h3 class='jltma-comments-title'>"; |
| 2758 |
|
| 2759 |
$comments_number = comments_number($no_comment, $one_comment, sprintf('%1$s %2$s', '%', $plural_comment)); |
| 2760 |
|
| 2761 |
echo esc_attr($comments_number) . ' on ' . get_the_title(); |
| 2762 |
echo "</h3>"; |
| 2763 |
} |
| 2764 |
} |
| 2765 |
|
| 2766 |
$this->jltma_comment_listing_inner_template(); |
| 2767 |
?> |
| 2768 |
</div> |
| 2769 |
|
| 2770 |
<?php } |
| 2771 |
|
| 2772 |
public function jltma_comment_template() |
| 2773 |
{ |
| 2774 |
|
| 2775 |
global $post, $comments; |
| 2776 |
$settings = $this->get_settings_for_display(); |
| 2777 |
$jltma_id = 'jltma-comment-' . $this->get_id(); |
| 2778 |
|
| 2779 |
$jltma_comment_style_preset = ($settings['jltma_comment_style_preset']) ? $settings['jltma_comment_style_preset'] : "style_one"; |
| 2780 |
|
| 2781 |
$this->add_render_attribute([ |
| 2782 |
'jltma_comments_wrap' => [ |
| 2783 |
'id' => esc_attr($jltma_id), |
| 2784 |
'class' => implode(' ', [ |
| 2785 |
'jltma-comments-wrap', |
| 2786 |
'jltma-comment-' . esc_attr($jltma_comment_style_preset), |
| 2787 |
absint($jltma_id) |
| 2788 |
]), |
| 2789 |
'data-jltma-comment-settings' => [ |
| 2790 |
wp_json_encode(array_filter([ |
| 2791 |
"container_id" => esc_attr($this->get_id()), |
| 2792 |
"template" => $jltma_comment_style_preset, |
| 2793 |
"reCaptchaprotected" => $settings['jltma_comment_spam_protection'] == "yes" ? $settings['jltma_comment_spam_protection'] : 'no', |
| 2794 |
])) |
| 2795 |
] |
| 2796 |
] |
| 2797 |
]); |
| 2798 |
|
| 2799 |
if (isset($settings['jltma_comment_spam_protection']) && $settings['jltma_comment_spam_protection'] == "yes") { |
| 2800 |
|
| 2801 |
$jltma_api_settings = get_option('jltma_api_save_settings'); |
| 2802 |
|
| 2803 |
$jltma_spam_protection = [ |
| 2804 |
'sitekey' => $jltma_api_settings['recaptcha_site_key'] ? $jltma_api_settings['recaptcha_site_key'] : '', |
| 2805 |
'theme' => "light" |
| 2806 |
]; |
| 2807 |
|
| 2808 |
$this->add_render_attribute(['jltma_comments_wrap' => [ |
| 2809 |
'data-recaptcha' => wp_json_encode($jltma_spam_protection) |
| 2810 |
]]); |
| 2811 |
} ?> |
| 2812 |
|
| 2813 |
<div <?php echo $this->get_render_attribute_string('jltma_comments_wrap'); ?>> |
| 2814 |
|
| 2815 |
<?php if (comments_open() && Comments_Builder::jltma_comment_elementor_preview_mode()) { |
| 2816 |
|
| 2817 |
$this->jltma_comment_list_template(); |
| 2818 |
|
| 2819 |
$this->jltma_frontend_form_build(); |
| 2820 |
} else { |
| 2821 |
|
| 2822 |
$this->jltma_comment_list_template(); |
| 2823 |
|
| 2824 |
$this->jltma_frontend_form_build(); |
| 2825 |
} ?> |
| 2826 |
</div> |
| 2827 |
|
| 2828 |
<?php } |
| 2829 |
|
| 2830 |
protected function render() |
| 2831 |
{ |
| 2832 |
|
| 2833 |
$settings = $this->get_settings_for_display(); |
| 2834 |
|
| 2835 |
$jltma_settings = new Comments_Builder($settings); |
| 2836 |
|
| 2837 |
$this->jltma_comment_template(); |
| 2838 |
} |
| 2839 |
} |
| 2840 |
|