flexible-list.php
53 lines
| 1 | <?php |
| 2 | if( class_exists('WPML_Elementor_Module_With_Items') ) { |
| 3 | /** |
| 4 | * Class WPML_Elementor_Icon_List |
| 5 | */ |
| 6 | class Auxin_WPML_Elementor_Icon_List extends WPML_Elementor_Module_With_Items { |
| 7 | /** |
| 8 | * @return string |
| 9 | */ |
| 10 | public function get_items_field() { |
| 11 | return 'list'; |
| 12 | } |
| 13 | /** |
| 14 | * @return array |
| 15 | */ |
| 16 | public function get_fields() { |
| 17 | return array( 'text_primary', 'text_secondary', 'link' => array( 'url' ) ); |
| 18 | } |
| 19 | /** |
| 20 | * @param string $field |
| 21 | * |
| 22 | * @return string |
| 23 | */ |
| 24 | protected function get_title( $field ) { |
| 25 | switch( $field ) { |
| 26 | case 'text_primary': |
| 27 | return esc_html__( 'Flexible List: Text', 'auxin-elements' ); |
| 28 | case 'text_secondary': |
| 29 | return esc_html__( 'Flexible List: Secondary Text', 'auxin-elements' ); |
| 30 | case 'link': |
| 31 | return esc_html__( 'Flexible List: Link', 'auxin-elements' ); |
| 32 | default: |
| 33 | return ''; |
| 34 | } |
| 35 | } |
| 36 | /** |
| 37 | * @param string $field |
| 38 | * |
| 39 | * @return string |
| 40 | */ |
| 41 | protected function get_editor_type( $field ) { |
| 42 | switch( $field ) { |
| 43 | case 'text_primary': |
| 44 | case 'text_secondary': |
| 45 | return 'LINE'; |
| 46 | case 'url': |
| 47 | return 'LINK'; |
| 48 | default: |
| 49 | return ''; |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | } |