hooks(); } private function hooks(){ add_action( 'init', array( $this, 'set_messages' ) ); // FixIn: 10.6.5.1. add_action('wpbc_hook_booking_page_header', array( $this, 'show_system_messages') ); add_action('wpbc_hook_add_booking_page_header', array( $this, 'show_system_messages') ); add_action('wpbc_hook_settings_page_header', array( $this, 'show_system_messages') ); } // FixIn: 10.6.5.1. public function set_messages(){ $this->messages['updated_paid_to_free'] = '' . esc_html__('Warning!' ,'booking') . ' ' /* translators: 1: ... */ . sprintf( __( 'Probably you updated your paid version of Booking Calendar by free version or update process failed. You can request the new update of your paid version at %1$sthis page%2$s.', 'booking') , '', '' ); } /** * Define secion for the system messages at the admin panel and show System Messages. * * @param type $my_page */ public function show_system_messages($my_page) { if (! empty($this->messages['updated_paid_to_free'])){ ?>
get_formated_message( $this->messages['updated_paid_to_free'], 'updated error' ); } ?>
show_message( $this->messages['updated_paid_to_free'] , 20 ); } /** * Show System Message(s) at the top of the admin page. * * @param string $message * @param int $time_to_show -in seconds if 0 then do not hide message * @param string $message_type : 'updated' | 'error' */ public function show_message ( $message, $time_to_show , $message_type = 'updated') { // Generate unique HTML ID for the message $inner_message_id = intval( time() * wp_rand(10, 100) ); // Get formated HTML message $notice = $this->get_formated_message( $message, $message_type, $inner_message_id ); // Get the time of message showing $time_to_show = intval($time_to_show)*1000; // Show this Message ?> ×'; // $my_close_open_alert_id = 'wpbc_system_message_id_'; // $notice .= '×'; if (! empty( $inner_message_id )) $inner_message_id = 'id="wpbc_inner_message_'. $inner_message_id .'"'; $notice = '
' . $notice . '
'; return $notice; } /* function show_alert($message) { $alert_head = __('Note' ,'booking'); $my_close_open_alert_id = 'bk_alert_settings_form_in_free'; ?>
" data-dismiss="alert" href="javascript:void(0)" onclick="javascript:wpbc_verify_window_opening(, '');" >×