PluginProbe
MotoPress Hotel Booking for Divi / 2.0.0
MotoPress Hotel Booking for Divi v2.0.0
trunk 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 2.0.0
mphb-divi / divi-4 / includes / modules / accommodation / attributes / attributes.php

attributes.php in MotoPress Hotel Booking for Divi 2.0.0, at divi-4/includes/modules/accommodation/attributes/attributes.php

40 lines 1019 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class MPHB_Divi_Accommodation_Type_Attributes_Module extends MPHB_Divi_Abstract_Accommodation_Module {
4
5 public $slug = 'mphb-divi-accommodation-type-attributes';
6
7 public function init() {
8 $this->name = esc_html__( 'HB Acc. Type Attributes', 'mphb-divi' );
9 }
10
11 public function mphb_get_fields() {
12
13 $attributes = self::get_accommodations_attributes_to_select();
14
15 $default = implode( ',', array_keys( $attributes ) );
16
17 return array(
18 'selected_attributes' => array(
19 'label' => esc_html__( 'Attributes', 'mphb-divi' ),
20 'type' => 'mphb_multiple_checkboxes',
21 'options' => $attributes,
22 'default' => $default,
23 'computed_affects' => array(
24 '__html',
25 ),
26 ),
27 );
28 }
29
30 public function mphb_render_depends_on() {
31 return array( 'selected_attributes' );
32 }
33
34 public static function get_html( $attrs = array() ) {
35 return MPHB_Divi_Renderers::accommodation_attributes( $attrs );
36 }
37 }
38
39 new MPHB_Divi_Accommodation_Type_Attributes_Module();
40