hooks(); } /** * Hooks. * * @return void */ private function hooks() { // Define Messages. add_action( 'init', array( $this, 'set_messages' ) ); // Where to show messages ? 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' ) ); } /** * Define messageas. * * @return void */ 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 string $my_page - tag of the page. */ public function show_system_messages( $my_page ) { if (! empty($this->messages['updated_paid_to_free'])){ ?>
' . esc_html( __( 'Hide', 'booking' ) ) . ''; $wpbc_metabox_id = 'wpbc_message_update_free_to_paid'; ob_start(); $is_panel_visible = wpbc_is_dismissed( $wpbc_metabox_id, array( 'title' => __( 'Dismiss', 'booking' ), // ' ', // ×. 'hint' => __( 'Dismiss Forever', 'booking' ), 'class' => 'wpbc_message_update_free_to_paid', 'css' => 'border-radius: 7px;margin: 10px 0 0 30px;text-decoration: underline;', ) ); ?>