control_groups[ $name ] = $data; } /** * Start controls group (aka Sections in Elementor) * * @param [type] $group [description] * @return [type] [description] */ public function start_jet_control_group( $group ) { $data = $this->control_groups[ $group ] ?? array(); $this->current_jet_tab = $data['tab'] ?? 'content'; $this->current_jet_group = $group; } /** * End controls grous * * @return [type] [description] */ public function end_jet_control_group() { $this->current_jet_tab = null; $this->current_jet_group = null; } /** * Wrapper to register control * * @param [type] $name [description] * @param array $data [description] * @return [type] [description] */ public function register_jet_control( $name, $data = array() ) { if ( ! $this->current_jet_tab ) { $this->current_jet_tab = 'content'; } $data['tab'] = $this->current_jet_tab; $data['group'] = $this->current_jet_group; $this->controls[ $name ] = $data; } public function get_jet_settings( $setting = null, $default_value = false ) { if ( ! $setting ) { return $this->settings; } $value = null; if ( isset( $this->settings[ $setting ] ) ) { $value = $this->settings[ $setting ]; } else { $value = isset( $this->controls[ $setting ] ) && isset( $this->controls[ $setting ]['default'] ) ? $this->controls[ $setting ]['default'] : $default_value; } return $value; } public function parse_jet_render_attributes( $attrs = array() ) { return apply_filters( 'jet-form-builder/bricks/element/parsed-attrs', $attrs, $this ); } }