← All changes
|
core/kits/documents/tabs/settings-site-identity.php
+17
-37
4.3.2
→
3.1.3
View file →
| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Core\Kits\Documents\Tabs; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Controls_Manager; |
| 6 | +use Elementor\Core\Files\Assets\Files_Upload_Handler; | |
| 6 | 7 | use Elementor\Core\Base\Document; |
| 7 | -use Elementor\Core\Files\Uploads_Manager; | |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; // Exit if accessed directly. | |
| 10 | + exit; // Exit if accessed directly | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | class Settings_Site_Identity extends Tab_Base { |
| 14 | 14 | |
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | return 'settings-site-identity'; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function get_title() { |
| 20 | - return esc_html__( 'Site Identity', 'elementor' ); | |
| 20 | + return __( 'Site Identity', 'elementor' ); | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function get_group() { |
| 24 | 24 | return 'settings'; |
| @@ -28,9 +28,9 @@ | ||
| 28 | 28 | return 'eicon-site-identity'; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function get_help_url() { |
| 32 | - return 'https://go.elementor.com/global-site-identity/'; | |
| 32 | + return 'https://go.elementor.com/global-site-identity'; | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | protected function register_tab_controls() { |
| 36 | 36 | $custom_logo_id = get_theme_mod( 'custom_logo' ); |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | $site_icon_id = get_option( 'site_icon' ); |
| 40 | 40 | $site_icon_src = wp_get_attachment_image_src( $site_icon_id, 'full' ); |
| 41 | 41 | |
| 42 | 42 | // If CANNOT upload svg normally, it will add a custom inline option to force svg upload if requested. (in logo and favicon) |
| 43 | - $should_include_svg_inline_option = ! Uploads_Manager::are_unfiltered_uploads_enabled(); | |
| 43 | + $should_include_svg_inline_option = ! Files_Upload_Handler::is_enabled(); | |
| 44 | 44 | |
| 45 | 45 | $this->start_controls_section( |
| 46 | 46 | 'section_' . $this->get_id(), |
| 47 | 47 | [ |
| @@ -52,17 +52,11 @@ | ||
| 52 | 52 | |
| 53 | 53 | $this->add_control( |
| 54 | 54 | $this->get_id() . '_refresh_notice', |
| 55 | 55 | [ |
| 56 | - 'type' => Controls_Manager::ALERT, | |
| 57 | - 'alert_type' => 'info', | |
| 58 | - 'content' => sprintf( | |
| 59 | - /* translators: 1: Link open tag, 2: Link open tag, 3: Link close tag. */ | |
| 60 | - esc_html__( 'Changes will be reflected only after %1$s saving %3$s and %2$s reloading %3$s preview.', 'elementor' ), | |
| 61 | - '<a href="javascript: $e.run( \'document/save/default\' )">', | |
| 62 | - '<a href="javascript: $e.run( \'preview/reload\' )">', | |
| 63 | - '</a>' | |
| 64 | - ), | |
| 56 | + 'type' => Controls_Manager::RAW_HTML, | |
| 57 | + 'raw' => __( 'Changes will be reflected in the preview only after the page reloads.', 'elementor' ), | |
| 58 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', | |
| 65 | 59 | ] |
| 66 | 60 | ); |
| 67 | 61 | |
| 68 | 62 | $this->add_control( |
| @@ -67,13 +61,12 @@ | ||
| 67 | 61 | |
| 68 | 62 | $this->add_control( |
| 69 | 63 | 'site_name', |
| 70 | 64 | [ |
| 71 | - 'label' => esc_html__( 'Site Name', 'elementor' ), | |
| 65 | + 'label' => __( 'Site Name', 'elementor' ), | |
| 72 | 66 | 'default' => get_option( 'blogname' ), |
| 73 | - 'placeholder' => esc_html__( 'Choose name', 'elementor' ), | |
| 67 | + 'placeholder' => __( 'Choose name', 'elementor' ), | |
| 74 | 68 | 'label_block' => true, |
| 75 | - 'export' => false, | |
| 76 | 69 | ] |
| 77 | 70 | ); |
| 78 | 71 | |
| 79 | 72 | $this->add_control( |
| @@ -78,13 +71,12 @@ | ||
| 78 | 71 | |
| 79 | 72 | $this->add_control( |
| 80 | 73 | 'site_description', |
| 81 | 74 | [ |
| 82 | - 'label' => esc_html__( 'Site Description', 'elementor' ), | |
| 75 | + 'label' => __( 'Site Description', 'elementor' ), | |
| 83 | 76 | 'default' => get_option( 'blogdescription' ), |
| 84 | - 'placeholder' => esc_html__( 'Choose description', 'elementor' ), | |
| 77 | + 'placeholder' => __( 'Choose description', 'elementor' ), | |
| 85 | 78 | 'label_block' => true, |
| 86 | - 'export' => false, | |
| 87 | 79 | ] |
| 88 | 80 | ); |
| 89 | 81 | |
| 90 | 82 | $this->add_control( |
| @@ -89,9 +81,9 @@ | ||
| 89 | 81 | |
| 90 | 82 | $this->add_control( |
| 91 | 83 | 'site_logo', |
| 92 | 84 | [ |
| 93 | - 'label' => esc_html__( 'Site Logo', 'elementor' ), | |
| 85 | + 'label' => __( 'Site Logo', 'elementor' ), | |
| 94 | 86 | 'type' => Controls_Manager::MEDIA, |
| 95 | 87 | 'should_include_svg_inline_option' => $should_include_svg_inline_option, |
| 96 | 88 | 'default' => [ |
| 97 | 89 | 'id' => $custom_logo_id, |
| @@ -96,20 +88,9 @@ | ||
| 96 | 88 | 'default' => [ |
| 97 | 89 | 'id' => $custom_logo_id, |
| 98 | 90 | 'url' => $custom_logo_src ? $custom_logo_src[0] : '', |
| 99 | 91 | ], |
| 100 | - 'description' => sprintf( | |
| 101 | - /* translators: 1: Width number pixel, 2: Height number pixel. */ | |
| 102 | - esc_html__( 'Suggested image dimensions: %1$s × %2$s pixels.', 'elementor' ), | |
| 103 | - '350', | |
| 104 | - '100' | |
| 105 | - ), | |
| 106 | - 'export' => false, | |
| 107 | - 'ai' => [ | |
| 108 | - 'active' => true, | |
| 109 | - 'type' => 'media', | |
| 110 | - 'category' => 'vector', | |
| 111 | - ], | |
| 92 | + 'description' => __( 'Suggested image dimensions: 350 × 100 pixels.', 'elementor' ), | |
| 112 | 93 | ] |
| 113 | 94 | ); |
| 114 | 95 | |
| 115 | 96 | $this->add_control( |
| @@ -114,9 +95,9 @@ | ||
| 114 | 95 | |
| 115 | 96 | $this->add_control( |
| 116 | 97 | 'site_favicon', |
| 117 | 98 | [ |
| 118 | - 'label' => esc_html__( 'Site Favicon', 'elementor' ), | |
| 99 | + 'label' => __( 'Site Favicon', 'elementor' ), | |
| 119 | 100 | 'type' => Controls_Manager::MEDIA, |
| 120 | 101 | 'should_include_svg_inline_option' => $should_include_svg_inline_option, |
| 121 | 102 | 'default' => [ |
| 122 | 103 | 'id' => $site_icon_id, |
| @@ -121,10 +102,9 @@ | ||
| 121 | 102 | 'default' => [ |
| 122 | 103 | 'id' => $site_icon_id, |
| 123 | 104 | 'url' => $site_icon_src ? $site_icon_src[0] : '', |
| 124 | 105 | ], |
| 125 | - 'description' => esc_html__( 'Suggested favicon dimensions: 512 × 512 pixels.', 'elementor' ), | |
| 126 | - 'export' => false, | |
| 106 | + 'description' => __( 'Suggested favicon dimensions: 512 × 512 pixels.', 'elementor' ), | |
| 127 | 107 | ] |
| 128 | 108 | ); |
| 129 | 109 | |
| 130 | 110 | $this->end_controls_section(); |
| @@ -131,9 +111,9 @@ | ||
| 131 | 111 | } |
| 132 | 112 | |
| 133 | 113 | public function on_save( $data ) { |
| 134 | 114 | if ( |
| 135 | - ! isset( $data['settings']['post_status'] ) || | |
| 115 | + ! isset( $data['settings'] ) || | |
| 136 | 116 | Document::STATUS_PUBLISH !== $data['settings']['post_status'] || |
| 137 | 117 | // Should check for the current action to avoid infinite loop |
| 138 | 118 | // when updating options like: "blogname" and "blogdescription". |
| 139 | 119 | strpos( current_action(), 'update_option_' ) === 0 |