| 1 |
<?php |
| 2 |
namespace UltimatePostKit\Includes; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Class WPML_UPK_Social_Share |
| 10 |
* Handles translation of repeater items in the Social Share widget |
| 11 |
*/ |
| 12 |
class WPML_UPK_Social_Share extends WPML_Module_With_Items { |
| 13 |
|
| 14 |
/** |
| 15 |
* @return string |
| 16 |
*/ |
| 17 |
public function get_items_field() { |
| 18 |
return 'share_buttons'; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* @return array |
| 23 |
*/ |
| 24 |
public function get_fields() { |
| 25 |
return array( |
| 26 |
'text', |
| 27 |
); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* @param string $field |
| 32 |
* @return string |
| 33 |
*/ |
| 34 |
protected function get_title( $field ) { |
| 35 |
switch ( $field ) { |
| 36 |
case 'text': |
| 37 |
return esc_html__( 'Custom Label', 'ultimate-post-kit' ); |
| 38 |
default: |
| 39 |
return ''; |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* @param string $field |
| 45 |
* @return string |
| 46 |
*/ |
| 47 |
protected function get_editor_type( $field ) { |
| 48 |
switch ( $field ) { |
| 49 |
case 'text': |
| 50 |
return 'LINE'; |
| 51 |
default: |
| 52 |
return 'LINE'; |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
|