$br ) { $br_option_title = $br['title']; if ( ( isset( $br['parent'] ) ) && ( $br['parent'] == 0 ) && ( isset( $br['count'] ) ) && ( $br['count'] > 1 ) ) { $br_option_title .= ' [' . __( 'parent resource', 'booking' ) . ']'; } // == CSS == $resources_arr_sorted[ $resource_index ]['css_class'] = 'wpbc_single_resource'; if ( isset( $br['parent'] ) ) { if ( $br['parent'] == 0 ) { if ( ( isset( $br['count'] ) ) && ( $br['count'] > 1 ) ) { $resources_arr_sorted[ $resource_index ]['css_class'] = 'wpbc_parent_resource'; } } else { $resources_arr_sorted[ $resource_index ]['css_class'] = 'wpbc_child_resource'; } } if ( 'wpbc_child_resource' === $resources_arr_sorted[ $resource_index ]['css_class'] ) { $br_option_title = '     ' . $br_option_title; } $resources_arr_sorted[ $resource_index ]['title'] = $br_option_title; } return $resources_arr_sorted; } /** * Get resource control default settings. * * Retrieve the default settings of the resource control. Used to return * the default settings while initializing the resource control. * * @since 1.0.0 * @access protected * @return array Currency control default settings. */ protected function get_default_settings(): array { return [ 'booking_resources' => self::get_booking_resources() ]; } /** * Get resource control default value. * * Retrieve the default value of the resource 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_resources_arr = self::get_booking_resources(); foreach ( $booking_resources_arr as $index => $resource_arr ) { return $resource_arr['booking_type_id']; } return '1'; } /** * Render resource 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(); ?>
<# if ( data.label ) {#> <# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #>