| Server IP : 89.108.64.180 / Your IP : 216.73.217.92 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/hostel76.com/wp-content/themes/hotelmaster/elementor/ |
Upload File : |
<?php
add_action( 'elementor/widgets/widgets_registered', 'hotelmaster_register_elementor_room_info_widget' );
function hotelmaster_register_elementor_room_info_widget(){
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Hotelmaster_Elementor_Room_Info_Widget() );
}
class Hotelmaster_Elementor_Room_Info_Widget extends \Elementor\Widget_Base {
public function get_name() {
return 'hotel-room-info';
}
public function get_title() {
return __( 'Hotel Room Info', 'gdlr_translate' );
}
public function get_icon() {
return 'fa fa-navicon';
}
public function get_categories() {
return [ 'hotelmaster' ];
}
protected function _register_controls() {
// title
$this->start_controls_section( 'settings-section',
[
'label' => __( 'Settings', 'gdlr_translate' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control( 'info-style',
[
'label' => __( 'Info Style', 'gdlr_translate' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => [
'classic-style' => __('Classic Style', 'gdlr_translate'),
'new-style'=> __('New Style' ,'gdlr_translate'),
],
'default' => 'new-style',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$gdlr_post_option = json_decode(gdlr_decode_preventslashes(get_post_meta(get_the_ID(), 'post-option', true)), true);
if( get_post_type() == 'room' ){
echo gdlr_hotel_room_info($gdlr_post_option, array(), true, $settings['info-style']);
}else if( get_post_type() == 'hostel_room' ){
echo gdlr_hostel_room_info($gdlr_post_option, array(), true, $settings['info-style']);
}else{
echo __('You can only use this item on "room" and "hostel room" post type.', 'gdlr_translate');
}
}
}