Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Here's my custom control
- $widget->add_control(
- 'wpf_fields_map',
- [
- 'label' => sprintf( __( '%s Field Mapping', 'elementor-pro' ), wp_fusion()->crm->name ),
- 'type' => Fields_Map::CONTROL_TYPE,
- 'separator' => 'before',
- 'fields' => [
- [
- 'name' => 'remote_id',
- 'type' => Controls_Manager::HIDDEN,
- ],
- [
- 'name' => 'local_id',
- 'type' => Controls_Manager::SELECT,
- ],
- ],
- 'default' => $this->get_fields(),
- ]
- );
- // Need to merge in new fields....
- $settings = $widget->get_settings();
- if ( ! empty( $settings['wpf_fields_map'] ) ) {
- $fields = $this->get_fields();
- $new_fields_map = array_merge( $fields, $settings['wpf_fields_map'] );
- $widget->set_settings( 'wpf_fields_map', $new_fields_map );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement