Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Translate Button V2, Simple Quote and blockquote
- * @param array $widgets
- * @return array
- */
- add_action('init', function (){
- add_filter( 'wpml_elementor_widgets_to_translate', 'qode_to_WPML' );
- });
- function qode_to_WPML($widgets) {
- $widgets['bridge_button_v2'] = [
- 'conditions' => ['widgetType' => 'bridge_button_v2'],
- 'fields' => [
- [
- 'field' => 'text',
- 'type' => __('Text', 'bridge-core'),
- 'editor_type' => 'LINE'
- ], //END OF FIRST WIDGET ELEMENT REGISTRATION
- [
- 'field' => 'link',
- 'type' => __('Link', 'bridge-core'),
- 'editor_type' => 'LINK'
- ], //END OF SECOND WIDGET ELEMENT REGISTRATION
- ],
- ];
- $widgets['bridge_simple_quote'] = [
- 'conditions' => ['widgetType' => 'bridge_simple_quote'],
- 'fields' => [
- [
- 'field' => 'simple_quote_text',
- 'type' => __('Simple Quote Text', 'bridge-core'),
- 'editor_type' => 'LINE'
- ], //END OF FIRST WIDGET ELEMENT REGISTRATION
- [
- 'field' => 'simple_quote_author',
- 'type' => __('Simple Quote Author', 'bridge-core'),
- 'editor_type' => 'LINE'
- ], //END OF SECOND WIDGET ELEMENT REGISTRATION
- ],
- ];
- $widgets['bridge_blockquote'] = [
- 'conditions' => ['widgetType' => 'bridge_blockquote'],
- 'fields' => [
- [
- 'field' => 'text',
- 'type' => __( "Text", 'bridge-core' ),
- 'editor_type' => 'AREA'
- ], //END OF FIRST WIDGET ELEMENT REGISTRATION
- ],
- ];
- return $widgets;
- }
- /**
- * Translate Numbered Process and Process Widgets
- * @param array $widgets
- * @return array
- */
- add_action('init', function (){
- add_filter( 'wpml_elementor_widgets_to_translate', 'qode_elementor_WPML_registration' );
- });
- function qode_elementor_WPML_registration($widgets)
- {
- $widgets['bridge_numbered_process'] = array(
- 'conditions' => array('widgetType' => 'bridge_numbered_process'),
- 'fields' => array(),
- 'integration-class' => array(
- 'numbered_items',
- )
- );
- $widgets['bridge_circles'] = array(
- 'conditions' => array('widgetType' => 'bridge_circles'),
- 'fields' => array(),
- 'integration-class' => array(
- 'process_items',
- )
- );
- return $widgets;
- }
- class numbered_items extends WPML_Elementor_Module_With_Items
- {
- public function get_items_field()
- {
- return 'numbered_process_items';
- }
- public function get_fields()
- {
- return array(
- 'number',
- 'title',
- );
- }
- protected function get_title($field)
- {
- switch ($field) {
- case 'number':
- return __('Number', 'bridge-core');
- case 'title':
- return __('Title', 'bridge-core');
- default:
- return '';
- }
- }
- protected function get_editor_type($field)
- {
- switch ($field) {
- case 'number':
- return 'LINE';
- case 'title':
- return 'LINE';
- default:
- return '';
- }
- }
- }
- class process_items extends WPML_Elementor_Module_With_Items
- {
- public function get_items_field()
- {
- return 'circles';
- }
- public function get_fields()
- {
- return array(
- 'text_in_circle',
- 'link',
- 'title',
- 'text',
- );
- }
- protected function get_title($field)
- {
- switch ($field) {
- case 'text_in_circle':
- return __( 'Text in Process', 'bridge-core');
- case 'title':
- return __( 'Title', 'bridge-core');
- case 'link':
- return __( 'Link', 'bridge-core');
- case 'text':
- return __( 'Text', 'bridge-core');
- default:
- return '';
- }
- }
- protected function get_editor_type($field)
- {
- switch ($field) {
- case 'text_in_circle':
- return 'LINE';
- case 'title':
- return 'LINE';
- case 'link':
- return 'LINK';
- case 'text':
- return 'AREA';
- default:
- return '';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement