PluginProbe
Elementor Website Builder – more than just a page builder / 3.24.8
Elementor Website Builder – more than just a page builder v3.24.8
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/heading.php +21 -169 4.0.73.24.8 View file →
@@ -7,11 +7,8 @@
7 7
8 8 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
9 9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10 10 use Elementor\Modules\ContentSanitizer\Interfaces\Sanitizable;
11 -use Elementor\Core\Utils\Hints;
12 -use Elementor\Core\Admin\Admin_Notices;
13 -use Elementor\Modules\Promotions\Controls\Promotion_Control;
14 11
15 12 /**
16 13 * Elementor heading widget.
17 14 *
@@ -110,16 +107,12 @@
110 107 public function get_style_depends(): array {
111 108 return [ 'widget-heading' ];
112 109 }
113 110
114 - public function has_widget_inner_wrapper(): bool {
115 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
116 - }
117 -
118 111 /**
119 112 * Remove data attributes from the html.
120 113 *
121 - * @param string $content Heading title.
114 + * @param string $content Heading title
122 115 * @return string
123 116 */
124 117 public function sanitize( $content ): string {
125 118 $allowed_tags = wp_kses_allowed_html( 'post' );
@@ -247,10 +240,8 @@
247 240 'default' => 'h2',
248 241 ]
249 242 );
250 243
251 - $this->maybe_add_ally_heading_hint();
252 -
253 244 $this->end_controls_section();
254 245
255 246 $this->start_controls_section(
256 247 'section_title_style',
@@ -265,10 +256,10 @@
265 256 [
266 257 'label' => esc_html__( 'Alignment', 'elementor' ),
267 258 'type' => Controls_Manager::CHOOSE,
268 259 'options' => [
269 - 'start' => [
270 - 'title' => esc_html__( 'Start', 'elementor' ),
260 + 'left' => [
261 + 'title' => esc_html__( 'Left', 'elementor' ),
271 262 'icon' => 'eicon-text-align-left',
272 263 ],
273 264 'center' => [
274 265 'title' => esc_html__( 'Center', 'elementor' ),
@@ -273,10 +264,10 @@
273 264 'center' => [
274 265 'title' => esc_html__( 'Center', 'elementor' ),
275 266 'icon' => 'eicon-text-align-center',
276 267 ],
277 - 'end' => [
278 - 'title' => esc_html__( 'End', 'elementor' ),
268 + 'right' => [
269 + 'title' => esc_html__( 'Right', 'elementor' ),
279 270 'icon' => 'eicon-text-align-right',
280 271 ],
281 272 'justify' => [
282 273 'title' => esc_html__( 'Justified', 'elementor' ),
@@ -282,21 +273,29 @@
282 273 'title' => esc_html__( 'Justified', 'elementor' ),
283 274 'icon' => 'eicon-text-align-justify',
284 275 ],
285 276 ],
286 - 'classes' => 'elementor-control-start-end',
287 - 'selectors_dictionary' => [
288 - 'left' => is_rtl() ? 'end' : 'start',
289 - 'right' => is_rtl() ? 'start' : 'end',
290 - ],
291 277 'default' => '',
292 278 'selectors' => [
293 279 '{{WRAPPER}}' => 'text-align: {{VALUE}};',
294 280 ],
295 - 'separator' => 'after',
296 281 ]
297 282 );
298 283
284 + $this->add_control(
285 + 'title_color',
286 + [
287 + 'label' => esc_html__( 'Text Color', 'elementor' ),
288 + 'type' => Controls_Manager::COLOR,
289 + 'global' => [
290 + 'default' => Global_Colors::COLOR_PRIMARY,
291 + ],
292 + 'selectors' => [
293 + '{{WRAPPER}} .elementor-heading-title' => 'color: {{VALUE}};',
294 + ],
295 + ]
296 + );
297 +
299 298 $this->add_group_control(
300 299 Group_Control_Typography::get_type(),
301 300 [
302 301 'name' => 'typography',
@@ -348,77 +347,8 @@
348 347 ],
349 348 ]
350 349 );
351 350
352 - $this->add_control(
353 - 'separator',
354 - [
355 - 'type' => Controls_Manager::DIVIDER,
356 - ]
357 - );
358 -
359 - $this->start_controls_tabs( 'title_colors' );
360 -
361 - $this->start_controls_tab(
362 - 'title_colors_normal',
363 - [
364 - 'label' => esc_html__( 'Normal', 'elementor' ),
365 - ]
366 - );
367 -
368 - $this->add_control(
369 - 'title_color',
370 - [
371 - 'label' => esc_html__( 'Text Color', 'elementor' ),
372 - 'type' => Controls_Manager::COLOR,
373 - 'global' => [
374 - 'default' => Global_Colors::COLOR_PRIMARY,
375 - ],
376 - 'selectors' => [
377 - '{{WRAPPER}} .elementor-heading-title' => 'color: {{VALUE}};',
378 - ],
379 - ]
380 - );
381 -
382 - $this->end_controls_tab();
383 -
384 - $this->start_controls_tab(
385 - 'title_colors_hover',
386 - [
387 - 'label' => esc_html__( 'Hover', 'elementor' ),
388 - ]
389 - );
390 -
391 - $this->add_control(
392 - 'title_hover_color',
393 - [
394 - 'label' => esc_html__( 'Link Color', 'elementor' ),
395 - 'type' => Controls_Manager::COLOR,
396 - 'selectors' => [
397 - '{{WRAPPER}} .elementor-heading-title a:hover, {{WRAPPER}} .elementor-heading-title a:focus' => 'color: {{VALUE}};',
398 - ],
399 - ]
400 - );
401 -
402 - $this->add_control(
403 - 'title_hover_color_transition_duration',
404 - [
405 - 'label' => esc_html__( 'Transition Duration', 'elementor' ),
406 - 'type' => Controls_Manager::SLIDER,
407 - 'size_units' => [ 's', 'ms', 'custom' ],
408 - 'default' => [
409 - 'unit' => 's',
410 - ],
411 - 'selectors' => [
412 - '{{WRAPPER}} .elementor-heading-title a' => 'transition-duration: {{SIZE}}{{UNIT}};',
413 - ],
414 - ]
415 - );
416 -
417 - $this->end_controls_tab();
418 -
419 - $this->end_controls_tabs();
420 -
421 351 $this->end_controls_section();
422 352 }
423 353
424 354 /**
@@ -459,86 +389,8 @@
459 389 // PHPCS - the variable $title_html holds safe data.
460 390 echo $title_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
461 391 }
462 392
463 - public function maybe_add_ally_heading_hint() {
464 - $notice_id = 'ally_heading_notice';
465 - $plugin_slug = 'pojo-accessibility';
466 -
467 - if ( ! Hints::should_display_hint( $notice_id ) ) {
468 - return;
469 - }
470 -
471 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
472 - $is_installed = Hints::is_plugin_installed( $plugin_slug );
473 - $is_active = Hints::is_plugin_active( $plugin_slug );
474 -
475 - if ( $is_active ) {
476 - return;
477 - }
478 -
479 - if ( $one_subscription ) {
480 - if ( ! $is_installed ) {
481 - $notice_content = esc_html__( 'Want to ensure this heading is accessible? Your ONE subscription includes Ally. Install it and scan your page.', 'elementor' );
482 - $button_text = esc_html__( 'Install now', 'elementor' );
483 - $button_url = Hints::get_plugin_install_url( $plugin_slug );
484 - $campaign_data = [
485 - 'name' => 'elementor_ea11y_campaign',
486 - 'campaign' => 'acc-scanner-plg-heading-one-install',
487 - 'source' => 'editor-heading-widget-one-install',
488 - 'medium' => 'editor-one',
489 - ];
490 - } elseif ( ! $is_active ) {
491 - $notice_content = esc_html__( 'Keep your content accessible. Activate Ally, included in ONE, to scan this page.', 'elementor' );
492 - $button_text = esc_html__( 'Activate now', 'elementor' );
493 - $button_url = Hints::get_plugin_activate_url( $plugin_slug );
494 - $campaign_data = [
495 - 'name' => 'elementor_ea11y_campaign',
496 - 'campaign' => 'acc-scanner-plg-heading-one-activate',
497 - 'source' => 'editor-heading-widget-one-non-activate',
498 - 'medium' => 'editor-one',
499 - ];
500 - }
501 - } else {
502 - $notice_content = esc_html__( 'Make sure your page is structured with accessibility in mind. Ally helps detect and fix common issues across your site.', 'elementor' );
503 - if ( ! $is_installed ) {
504 - $button_text = esc_html__( 'Install now', 'elementor' );
505 - $button_url = Hints::get_plugin_install_url( $plugin_slug );
506 - } elseif ( ! $is_active ) {
507 - $button_text = esc_html__( 'Activate now', 'elementor' );
508 - $button_url = Hints::get_plugin_activate_url( $plugin_slug );
509 - }
510 - $campaign_data = [
511 - 'name' => 'elementor_ea11y_campaign',
512 - 'campaign' => 'acc-scanner-plg-heading',
513 - 'source' => 'editor-heading-widget',
514 - 'medium' => 'editor',
515 - ];
516 - }
517 -
518 - $notice_heading = esc_html__( 'Accessible structure matters', 'elementor' );
519 -
520 - $this->add_control(
521 - $notice_id,
522 - [
523 - 'type' => Controls_Manager::RAW_HTML,
524 - 'raw' => Hints::get_notice_template( [
525 - 'display' => ! Hints::is_dismissed( $notice_id ),
526 - 'heading' => $notice_heading,
527 - 'type' => 'info',
528 - 'content' => $notice_content,
529 - 'icon' => true,
530 - 'dismissible' => $notice_id,
531 - 'button_text' => $button_text,
532 - 'button_event' => $notice_id,
533 - 'button_data' => [
534 - 'action_url' => Admin_Notices::add_plg_campaign_data( $button_url, $campaign_data ),
535 - ],
536 - ], true ),
537 - ]
538 - );
539 - }
540 -
541 393 /**
542 394 * Render heading widget output in the editor.
543 395 *
544 396 * Written as a Backbone JavaScript template and used to generate the live preview.
@@ -550,10 +402,10 @@
550 402 ?>
551 403 <#
552 404 let title = elementor.helpers.sanitize( settings.title, { ALLOW_DATA_ATTR: false } );
553 405
554 - if ( '' !== settings.link?.url ) {
555 - title = '<a href="' + elementor.helpers.sanitizeUrl( settings.link?.url ) + '">' + title + '</a>';
406 + if ( '' !== settings.link.url ) {
407 + title = '<a href="' + elementor.helpers.sanitizeUrl( settings.link.url ) + '">' + title + '</a>';
556 408 }
557 409
558 410 view.addRenderAttribute( 'title', 'class', [ 'elementor-heading-title' ] );
559 411