| @@ -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 info@wpbookingcalendar.com |
| 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 | |
| @@ -62,9 +63,9 @@ | ||
| 62 | 63 | |
| 63 | 64 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing |
| 64 | 65 | if ( ( isset( $_POST['action'] ) ) && ( 'wpbc_page_resource_publish' === $_POST['action'] ) ) { |
| 65 | 66 | |
| 66 | - if ( wpbc_is_this_demo() ) { | |
| 67 | + if ( wpbc_is_booking_form_publishing_restricted() ) { | |
| 67 | 68 | wpbc_show_notice__for_page_resource_publish( 'This operation is restricted in the demo version.', 'warning' ); |
| 68 | 69 | return; |
| 69 | 70 | } |
| 70 | 71 | |
| @@ -189,14 +190,29 @@ | ||
| 189 | 190 | } |
| 190 | 191 | |
| 191 | 192 | } |
| 192 | 193 | } |
| 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;"> | |
| 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 ); ?>"> | |
| 199 | 215 | <strong><?php |
| 200 | 216 | if ( ( 'error' == $message_type ) ) { |
| 201 | 217 | echo esc_html__( 'Error', 'booking' ) . '! '; |
| 202 | 218 | } ?></strong> <?php |
| @@ -212,9 +228,10 @@ | ||
| 212 | 228 | function wpbc_write_content_for_modal__page_resource_publish( $page_name ) { |
| 213 | 229 | |
| 214 | 230 | if ( |
| 215 | 231 | ( 'resources' !== $page_name ) && |
| 216 | - ( 'wpbc-ajx_booking_setup_wizard' !== $page_name ) | |
| 232 | + ( 'wpbc-ajx_booking_setup_wizard' !== $page_name ) && | |
| 233 | + ( ! wpbc_is_builder_booking_form_page() ) | |
| 217 | 234 | // && ( 'wpbc-ajx_booking' !== $page_name ) // FixIn: 10.6.6.2. |
| 218 | 235 | ){ |
| 219 | 236 | return false; |
| 220 | 237 | } |
| @@ -279,9 +296,9 @@ | ||
| 279 | 296 | </div> |
| 280 | 297 | <div class="modal-body"> |
| 281 | 298 | <div id="wpbc_content_for_js_resource_publish"> |
| 282 | 299 | <?php |
| 283 | - if ( wpbc_is_this_demo() ) { | |
| 300 | + if ( wpbc_is_booking_form_publishing_restricted() ) { | |
| 284 | 301 | wpbc_show_notice__for_page_resource_publish( 'In the demo versions such operation is not allowed.', 'warning' ); |
| 285 | 302 | } else { |
| 286 | 303 | ?> |
| 287 | 304 | <form method="post" action=""> |