| @@ -258,10 +258,10 @@ | ||
| 258 | 258 | [ |
| 259 | 259 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| 260 | 260 | 'type' => Controls_Manager::CHOOSE, |
| 261 | 261 | 'options' => [ |
| 262 | - 'start' => [ | |
| 263 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 262 | + 'left' => [ | |
| 263 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 264 | 264 | 'icon' => 'eicon-text-align-left', |
| 265 | 265 | ], |
| 266 | 266 | 'center' => [ |
| 267 | 267 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -266,18 +266,13 @@ | ||
| 266 | 266 | 'center' => [ |
| 267 | 267 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 268 | 268 | 'icon' => 'eicon-text-align-center', |
| 269 | 269 | ], |
| 270 | - 'end' => [ | |
| 271 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 270 | + 'right' => [ | |
| 271 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 272 | 272 | 'icon' => 'eicon-text-align-right', |
| 273 | 273 | ], |
| 274 | 274 | ], |
| 275 | - 'classes' => 'elementor-control-start-end', | |
| 276 | - 'selectors_dictionary' => [ | |
| 277 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 278 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 279 | - ], | |
| 280 | 275 | 'selectors' => [ |
| 281 | 276 | '{{WRAPPER}}' => 'text-align: {{VALUE}};', |
| 282 | 277 | ], |
| 283 | 278 | ] |
| @@ -581,10 +576,10 @@ | ||
| 581 | 576 | [ |
| 582 | 577 | 'label' => esc_html__( 'Alignment', 'elementor' ), |
| 583 | 578 | 'type' => Controls_Manager::CHOOSE, |
| 584 | 579 | 'options' => [ |
| 585 | - 'start' => [ | |
| 586 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 580 | + 'left' => [ | |
| 581 | + 'title' => esc_html__( 'Left', 'elementor' ), | |
| 587 | 582 | 'icon' => 'eicon-text-align-left', |
| 588 | 583 | ], |
| 589 | 584 | 'center' => [ |
| 590 | 585 | 'title' => esc_html__( 'Center', 'elementor' ), |
| @@ -589,10 +584,10 @@ | ||
| 589 | 584 | 'center' => [ |
| 590 | 585 | 'title' => esc_html__( 'Center', 'elementor' ), |
| 591 | 586 | 'icon' => 'eicon-text-align-center', |
| 592 | 587 | ], |
| 593 | - 'end' => [ | |
| 594 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 588 | + 'right' => [ | |
| 589 | + 'title' => esc_html__( 'Right', 'elementor' ), | |
| 595 | 590 | 'icon' => 'eicon-text-align-right', |
| 596 | 591 | ], |
| 597 | 592 | 'justify' => [ |
| 598 | 593 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| @@ -598,13 +593,8 @@ | ||
| 598 | 593 | 'title' => esc_html__( 'Justified', 'elementor' ), |
| 599 | 594 | 'icon' => 'eicon-text-align-justify', |
| 600 | 595 | ], |
| 601 | 596 | ], |
| 602 | - 'classes' => 'elementor-control-start-end', | |
| 603 | - 'selectors_dictionary' => [ | |
| 604 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 605 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 606 | - ], | |
| 607 | 597 | 'default' => '', |
| 608 | 598 | 'selectors' => [ |
| 609 | 599 | '{{WRAPPER}} .widget-image-caption' => 'text-align: {{VALUE}};', |
| 610 | 600 | ], |
| @@ -771,64 +761,8 @@ | ||
| 771 | 761 | <?php if ( $has_caption ) : ?> |
| 772 | 762 | </figure> |
| 773 | 763 | <?php endif; ?> |
| 774 | 764 | <?php |
| 775 | - } | |
| 776 | - | |
| 777 | - public function render_markdown(): string { | |
| 778 | - $settings = $this->get_settings_for_display(); | |
| 779 | - | |
| 780 | - if ( empty( $settings['image']['url'] ) ) { | |
| 781 | - return ''; | |
| 782 | - } | |
| 783 | - | |
| 784 | - $url = esc_url( $settings['image']['url'] ); | |
| 785 | - $alt = $this->get_image_alt_text( $settings ); | |
| 786 | - $image_md = ''; | |
| 787 | - | |
| 788 | - $link = $this->get_link_url( $settings ); | |
| 789 | - | |
| 790 | - if ( ! empty( $link['url'] ) && $link['url'] !== $url ) { | |
| 791 | - $image_md = '[' . $image_md . '](' . esc_url( $link['url'] ) . ')'; | |
| 792 | - } | |
| 793 | - | |
| 794 | - $caption = $this->get_visible_caption( $settings ); | |
| 795 | - | |
| 796 | - if ( ! empty( $caption ) ) { | |
| 797 | - $image_md .= "\n" . $caption; | |
| 798 | - } | |
| 799 | - | |
| 800 | - return $image_md; | |
| 801 | - } | |
| 802 | - | |
| 803 | - private function get_image_alt_text( array $settings ): string { | |
| 804 | - if ( empty( $settings['image']['id'] ) ) { | |
| 805 | - return ''; | |
| 806 | - } | |
| 807 | - | |
| 808 | - $attachment_id = $settings['image']['id']; | |
| 809 | - | |
| 810 | - $alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ); | |
| 811 | - | |
| 812 | - if ( ! empty( $alt ) ) { | |
| 813 | - return $alt; | |
| 814 | - } | |
| 815 | - | |
| 816 | - $attachment = get_post( $attachment_id ); | |
| 817 | - | |
| 818 | - if ( ! $attachment ) { | |
| 819 | - return ''; | |
| 820 | - } | |
| 821 | - | |
| 822 | - return $attachment->post_title ?? ''; | |
| 823 | - } | |
| 824 | - | |
| 825 | - private function get_visible_caption( array $settings ): string { | |
| 826 | - if ( ! $this->has_caption( $settings ) ) { | |
| 827 | - return ''; | |
| 828 | - } | |
| 829 | - | |
| 830 | - return Utils::html_to_plain_text( $this->get_caption( $settings ) ); | |
| 831 | 765 | } |
| 832 | 766 | |
| 833 | 767 | /** |
| 834 | 768 | * Render image widget output in the editor. |