PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
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 10.11 All 204 releases
← All changes | includes/publish/wpbc-publish-shortcode.php +23 -8 11.211.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * @version 1.0
4 4 * @package Booking Calendar
@@ -63,9 +63,9 @@
63 63
64 64 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
65 65 if ( ( isset( $_POST['action'] ) ) && ( 'wpbc_page_resource_publish' === $_POST['action'] ) ) {
66 66
67 - if ( wpbc_is_this_demo() ) {
67 + if ( wpbc_is_booking_form_publishing_restricted() ) {
68 68 wpbc_show_notice__for_page_resource_publish( 'This operation is restricted in the demo version.', 'warning' );
69 69 return;
70 70 }
71 71
@@ -190,14 +190,29 @@
190 190 }
191 191
192 192 }
193 193 }
194 -add_action( 'wpbc_hook_settings_page_before_content_table', 'wpbc_check_for_submit__page_resource_publish' ,10, 1);
195 -
196 -
197 -function wpbc_show_notice__for_page_resource_publish( $message, $message_type = 'success' ) {
198 - ?>
199 - <div class="wpbc-settings-notice notice-<?php echo esc_attr( $message_type ); ?>" style="text-align:left;font-size: 1rem;margin-top:20px;">
194 +add_action( 'wpbc_hook_settings_page_before_content_table', 'wpbc_check_for_submit__page_resource_publish' ,10, 1);
195 +
196 +/**
197 + * Render feedback from the Booking Resource publishing workflow.
198 + *
199 + * The shared publisher is also used outside the Resources catalog, so catalog
200 + * spacing is applied only while the new catalog renderer owns the request.
201 + *
202 + * @param string $message Escaped or deliberately prepared notice markup.
203 + * @param string $message_type Notice type used by the Booking Calendar notice styles.
204 + *
205 + * @return void
206 + */
207 +function wpbc_show_notice__for_page_resource_publish( $message, $message_type = 'success' ) {
208 + $notice_style = 'text-align:left;font-size:1rem;margin-top:20px;';
209 +
210 + if ( function_exists( 'wpbc_catalog_booking_resources_is_page' ) && wpbc_catalog_booking_resources_is_page() ) {
211 + $notice_style = 'text-align:left;font-size:1rem;margin:0 0 40px;';
212 + }
213 + ?>
214 + <div class="wpbc-settings-notice notice-<?php echo esc_attr( $message_type ); ?>" style="<?php echo esc_attr( $notice_style ); ?>">
200 215 <strong><?php
201 216 if ( ( 'error' == $message_type ) ) {
202 217 echo esc_html__( 'Error', 'booking' ) . '! ';
203 218 } ?></strong> <?php
@@ -281,9 +296,9 @@
281 296 </div>
282 297 <div class="modal-body">
283 298 <div id="wpbc_content_for_js_resource_publish">
284 299 <?php
285 - if ( wpbc_is_this_demo() ) {
300 + if ( wpbc_is_booking_form_publishing_restricted() ) {
286 301 wpbc_show_notice__for_page_resource_publish( 'In the demo versions such operation is not allowed.', 'warning' );
287 302 } else {
288 303 ?>
289 304 <form method="post" action="">