PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.2
Elementor Website Builder – more than just a page builder v3.26.2
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/image.php +10 -76 4.1.03.26.2 View file →
@@ -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 ],
@@ -702,9 +692,9 @@
702 692 * Get the caption for current widget.
703 693 *
704 694 * @access private
705 695 * @since 2.3.0
706 - * @param array $settings
696 + * @param $settings
707 697 *
708 698 * @return string
709 699 */
710 700 private function get_caption( $settings ) {
@@ -773,64 +763,8 @@
773 763 <?php endif; ?>
774 764 <?php
775 765 }
776 766
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 = '![' . $alt . '](' . $url . ')';
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 - }
832 -
833 767 /**
834 768 * Render image widget output in the editor.
835 769 *
836 770 * Written as a Backbone JavaScript template and used to generate the live preview.
@@ -887,9 +821,9 @@
887 821
888 822 var link_url;
889 823
890 824 if ( 'custom' === settings.link_to ) {
891 - link_url = settings.link?.url;
825 + link_url = settings.link.url;
892 826 }
893 827
894 828 if ( 'file' === settings.link_to ) {
895 829 link_url = settings.image.url;