← All changes
|
modules/nested-accordion/widgets/nested-accordion.php
+11
-36
4.3.0
→
3.28.0-dev2
View file →
| @@ -30,12 +30,8 @@ | ||
| 30 | 30 | |
| 31 | 31 | private $optimized_markup = null; |
| 32 | 32 | private $widget_container_selector = ''; |
| 33 | 33 | |
| 34 | - protected function is_dynamic_content(): bool { | |
| 35 | - return true; | |
| 36 | - } | |
| 37 | - | |
| 38 | 34 | public function get_name() { |
| 39 | 35 | return 'nested-accordion'; |
| 40 | 36 | } |
| 41 | 37 | |
| @@ -55,9 +51,9 @@ | ||
| 55 | 51 | return [ 'widget-nested-accordion' ]; |
| 56 | 52 | } |
| 57 | 53 | |
| 58 | 54 | public function show_in_panel(): bool { |
| 59 | - return Plugin::$instance->experiments->is_feature_active( 'container' ); | |
| 55 | + return Plugin::$instance->experiments->is_feature_active( 'nested-elements', true ); | |
| 60 | 56 | } |
| 61 | 57 | |
| 62 | 58 | public function has_widget_inner_wrapper(): bool { |
| 63 | 59 | return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| @@ -66,13 +62,9 @@ | ||
| 66 | 62 | protected function item_content_container( int $index ) { |
| 67 | 63 | return [ |
| 68 | 64 | 'elType' => 'container', |
| 69 | 65 | 'settings' => [ |
| 70 | - '_title' => sprintf( | |
| 71 | - /* translators: %d: Item index. */ | |
| 72 | - __( 'item #%d', 'elementor' ), | |
| 73 | - $index | |
| 74 | - ), | |
| 66 | + '_title' => sprintf( __( 'item #%s', 'elementor' ), $index ), | |
| 75 | 67 | 'content_width' => 'full', |
| 76 | 68 | ], |
| 77 | 69 | ]; |
| 78 | 70 | } |
| @@ -89,9 +81,8 @@ | ||
| 89 | 81 | return 'item_title'; |
| 90 | 82 | } |
| 91 | 83 | |
| 92 | 84 | protected function get_default_children_title() { |
| 93 | - /* translators: %d: Item index. */ | |
| 94 | 85 | return esc_html__( 'Item #%d', 'elementor' ); |
| 95 | 86 | } |
| 96 | 87 | |
| 97 | 88 | protected function get_default_children_placeholder_selector() { |
| @@ -325,9 +316,9 @@ | ||
| 325 | 316 | 'faq_schema_message', |
| 326 | 317 | [ |
| 327 | 318 | 'type' => Controls_Manager::ALERT, |
| 328 | 319 | 'alert_type' => 'info', |
| 329 | - 'content' => esc_html__( 'Google no longer supports the FAQ schema; however, it may still hold secondary value for AI and LLMs.', 'elementor' ), | |
| 320 | + 'content' => esc_html__( 'Let Google know that this section contains an FAQ. Make sure to only use it only once per page', 'elementor' ), | |
| 330 | 321 | 'condition' => [ |
| 331 | 322 | 'faq_schema[value]' => 'yes', |
| 332 | 323 | ], |
| 333 | 324 | ] |
| @@ -937,22 +928,13 @@ | ||
| 937 | 928 | }; |
| 938 | 929 | |
| 939 | 930 | const itemTitleTextAttributes = { |
| 940 | 931 | 'class': [ 'e-n-accordion-item-title-text' ], |
| 941 | - 'data-binding-index': view.collection.length + 1, | |
| 942 | 932 | 'data-binding-type': 'repeater-item', |
| 943 | 933 | 'data-binding-repeater-name': 'items', |
| 944 | - 'data-binding-setting': ['item_title', 'element_css_id'], | |
| 945 | - 'data-binding-config': JSON.stringify({ | |
| 946 | - 'element_css_id': { | |
| 947 | - editType: 'attribute', | |
| 948 | - attr: 'id', | |
| 949 | - selector: 'details' | |
| 950 | - }, | |
| 951 | - 'item_title': { | |
| 952 | - editType: 'text' | |
| 953 | - } | |
| 954 | - }), | |
| 934 | + 'data-binding-setting': ['item_title'], | |
| 935 | + 'data-binding-index': view.collection.length + 1, | |
| 936 | + 'data-binding-dynamic': 'true', | |
| 955 | 937 | }; |
| 956 | 938 | |
| 957 | 939 | view.addRenderAttribute( 'details-container', itemWrapperAttributes, null, true ); |
| 958 | 940 | view.addRenderAttribute( 'summary-container', itemTitleAttributes, null, true ); |
| @@ -1020,22 +1002,15 @@ | ||
| 1020 | 1002 | }); |
| 1021 | 1003 | |
| 1022 | 1004 | view.addRenderAttribute( itemTitleTextKey, { |
| 1023 | 1005 | 'class': ['e-n-accordion-item-title-text'], |
| 1024 | - 'data-binding-index': itemCount, | |
| 1025 | 1006 | 'data-binding-type': 'repeater-item', |
| 1026 | 1007 | 'data-binding-repeater-name': 'items', |
| 1027 | - 'data-binding-setting': ['item_title', 'element_css_id'], | |
| 1028 | - 'data-binding-config': JSON.stringify({ | |
| 1029 | - 'element_css_id': { | |
| 1030 | - editType: 'attribute', | |
| 1031 | - attr: 'id', | |
| 1032 | - selector: 'details' | |
| 1033 | - }, | |
| 1034 | - 'item_title': { | |
| 1035 | - editType: 'text' | |
| 1036 | - } | |
| 1037 | - }), | |
| 1008 | + 'data-binding-setting': ['item_title'], | |
| 1009 | + 'data-binding-index': itemCount, | |
| 1010 | + 'data-binding-dynamic': 'true', | |
| 1011 | + 'data-binding-dynamic-css-id': 'element_css_id', | |
| 1012 | + 'data-binding-single-item-html-wrapper-tag': 'details', | |
| 1038 | 1013 | }); |
| 1039 | 1014 | #> |
| 1040 | 1015 | |
| 1041 | 1016 | <details {{{ view.getRenderAttributeString( itemWrapperKey ) }}}> |