| @@ -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=""> |