$form_item ) { if ( is_array( $form_item ) ) { if ( isset( $form_item['optgroup'] ) ) { $sorted_options_list[] = $form_item; } else { // Legacy skins with attributes: 'style=>'color:#ccc;' . $form_item['slug'] = $slug; $sorted_options_list[] = $form_item; } } else { $sorted_options_list[] = array( 'slug' => $slug, 'title' => $form_item, ); } } return $sorted_options_list; } /** * Get custom_form control default settings. * * Retrieve the default settings of the custom_form control. Used to return * the default settings while initializing the custom_form control. * * @since 1.0.0 * @access protected * @return array Currency control default settings. */ protected function get_default_settings(): array { return [ 'booking_custom_forms' => self::get_booking_custom_forms() ]; } /** * Get custom_form control default value. * * Retrieve the default value of the custom_form control. Used to return the * default value while initializing the control. * * @since 1.0.0 * @access public * @return array Currency control default value. */ public function get_default_value(): string { $booking_custom_forms_arr = self::get_booking_custom_forms(); foreach ( $booking_custom_forms_arr as $index => $custom_form_arr ) { return $custom_form_arr['slug']; } return 'standard'; } /** * Render custom_form control output in the editor. * * Used to generate the control HTML in the editor using Underscore JS * template. The variables for the class are available using `data` JS * object. * * @since 1.0.0 * @access public */ public function content_template(): void { $control_uid = $this->get_control_uid(); ?>