PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | includes/publish/wpbc-publish-shortcode.php +31 -16 10.10.2 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * @version 1.0
4 4 * @package Booking Calendar
@@ -9,8 +9,9 @@
9 9 * @link https://wpbookingcalendar.com/
10 10 * @email [email protected]
11 11 *
12 12 * @modified 2023-12-27
13 + * @file: ../includes/publish/wpbc-publish-shortcode.php
13 14 */
14 15
15 16 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly // FixIn: 9.8.15.5.
16 17
@@ -50,12 +51,11 @@
50 51 * @return false|void
51 52 */
52 53 function wpbc_check_for_submit__page_resource_publish( $page_name ) {
53 54
54 - if (
55 - ( 'resources' !== $page_name )
56 - // && ( 'wpbc-ajx_booking_setup_wizard' !== $page_name )
57 - ){
55 + if (
56 + ( 'resources' !== $page_name )
57 + ){
58 58 return false;
59 59 }
60 60
61 61 // Check $_POST
@@ -62,9 +62,9 @@
62 62
63 63 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
64 64 if ( ( isset( $_POST['action'] ) ) && ( 'wpbc_page_resource_publish' === $_POST['action'] ) ) {
65 65
66 - if ( wpbc_is_this_demo() ) {
66 + if ( wpbc_is_booking_form_publishing_restricted() ) {
67 67 wpbc_show_notice__for_page_resource_publish( 'This operation is restricted in the demo version.', 'warning' );
68 68 return;
69 69 }
70 70
@@ -189,14 +189,29 @@
189 189 }
190 190
191 191 }
192 192 }
193 -add_action( 'wpbc_hook_settings_page_before_content_table', 'wpbc_check_for_submit__page_resource_publish' ,10, 1);
194 -
195 -
196 -function wpbc_show_notice__for_page_resource_publish( $message, $message_type = 'success' ) {
197 - ?>
198 - <div class="wpbc-settings-notice notice-<?php echo esc_attr( $message_type ); ?>" style="text-align:left;font-size: 1rem;margin-top:20px;">
193 +add_action( 'wpbc_hook_settings_page_before_content_table', 'wpbc_check_for_submit__page_resource_publish' ,10, 1);
194 +
195 +/**
196 + * Render feedback from the Booking Resource publishing workflow.
197 + *
198 + * The shared publisher is also used outside the Resources catalog, so catalog
199 + * spacing is applied only while the new catalog renderer owns the request.
200 + *
201 + * @param string $message Escaped or deliberately prepared notice markup.
202 + * @param string $message_type Notice type used by the Booking Calendar notice styles.
203 + *
204 + * @return void
205 + */
206 +function wpbc_show_notice__for_page_resource_publish( $message, $message_type = 'success' ) {
207 + $notice_style = 'text-align:left;font-size:1rem;margin-top:20px;';
208 +
209 + if ( function_exists( 'wpbc_catalog_booking_resources_is_page' ) && wpbc_catalog_booking_resources_is_page() ) {
210 + $notice_style = 'text-align:left;font-size:1rem;margin:0 0 40px;';
211 + }
212 + ?>
213 + <div class="wpbc-settings-notice notice-<?php echo esc_attr( $message_type ); ?>" style="<?php echo esc_attr( $notice_style ); ?>">
199 214 <strong><?php
200 215 if ( ( 'error' == $message_type ) ) {
201 216 echo esc_html__( 'Error', 'booking' ) . '! ';
202 217 } ?></strong> <?php
@@ -210,13 +225,13 @@
210 225
211 226 /** Publish Layout - Modal Window structure */
212 227 function wpbc_write_content_for_modal__page_resource_publish( $page_name ) {
213 228
214 - if (
215 - ( 'resources' !== $page_name ) &&
216 - ( 'wpbc-ajx_booking_setup_wizard' !== $page_name )
229 + if (
230 + ( 'resources' !== $page_name ) &&
231 + ( ! wpbc_is_builder_booking_form_page() )
217 232 // && ( 'wpbc-ajx_booking' !== $page_name ) // FixIn: 10.6.6.2.
218 - ){
233 + ){
219 234 return false;
220 235 }
221 236
222 237 ?><span class="wpdevelop"><?php
@@ -279,9 +294,9 @@
279 294 </div>
280 295 <div class="modal-body">
281 296 <div id="wpbc_content_for_js_resource_publish">
282 297 <?php
283 - if ( wpbc_is_this_demo() ) {
298 + if ( wpbc_is_booking_form_publishing_restricted() ) {
284 299 wpbc_show_notice__for_page_resource_publish( 'In the demo versions such operation is not allowed.', 'warning' );
285 300 } else {
286 301 ?>
287 302 <form method="post" action="">