carousel.php
4 years ago
fancy-text.php
4 years ago
grid.php
4 years ago
icon-list.php
4 years ago
maps.php
4 years ago
person.php
4 years ago
pricing-table.php
4 years ago
progress-bar.php
4 years ago
vertical-scroll.php
4 years ago
person.php
99 lines
| 1 | <?php |
| 2 | /** |
| 3 | * PA WPML Premium Person. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Compatibility\WPML\Widgets; |
| 7 | |
| 8 | use WPML_Elementor_Module_With_Items; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; // No access of directly access. |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Person |
| 16 | * |
| 17 | * Registers translatable widget with items. |
| 18 | * |
| 19 | * @since 3.1.9 |
| 20 | */ |
| 21 | class Person extends WPML_Elementor_Module_With_Items { |
| 22 | |
| 23 | /** |
| 24 | * Retrieve the field name. |
| 25 | * |
| 26 | * @since 3.1.9 |
| 27 | * @return string |
| 28 | */ |
| 29 | public function get_items_field() { |
| 30 | return 'multiple_persons'; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Retrieve the fields inside the repeater. |
| 35 | * |
| 36 | * @since 3.1.9 |
| 37 | * |
| 38 | * @return array |
| 39 | */ |
| 40 | public function get_fields() { |
| 41 | return array( |
| 42 | 'multiple_name', |
| 43 | 'multiple_title', |
| 44 | 'multiple_description', |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get the title for each repeater string |
| 50 | * |
| 51 | * @since 3.1.9 |
| 52 | * |
| 53 | * @param string $field control ID. |
| 54 | * |
| 55 | * @return string |
| 56 | */ |
| 57 | protected function get_title( $field ) { |
| 58 | |
| 59 | switch ( $field ) { |
| 60 | case 'multiple_name': |
| 61 | return esc_html__( 'Multiple Persons: Person Name', 'premium-addons-for-elementor' ); |
| 62 | |
| 63 | case 'multiple_title': |
| 64 | return esc_html__( 'Multiple Persons: Person Title', 'premium-addons-for-elementor' ); |
| 65 | |
| 66 | case 'multiple_description': |
| 67 | return esc_html__( 'Multiple Persons: Person Description', 'premium-addons-for-elementor' ); |
| 68 | |
| 69 | default: |
| 70 | return ''; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Get `editor_type` for each repeater string |
| 76 | * |
| 77 | * @since 3.1.9 |
| 78 | * |
| 79 | * @param string $field control ID. |
| 80 | * |
| 81 | * @return string |
| 82 | */ |
| 83 | protected function get_editor_type( $field ) { |
| 84 | |
| 85 | switch ( $field ) { |
| 86 | case 'multiple_name': |
| 87 | case 'multiple_title': |
| 88 | return 'LINE'; |
| 89 | |
| 90 | case 'multiple_description': |
| 91 | return 'AREA'; |
| 92 | |
| 93 | default: |
| 94 | return ''; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | } |
| 99 |