PluginProbe
Easy Hotel – Powerful Hotel Booking / 2.0.4
Easy Hotel – Powerful Hotel Booking v2.0.4
2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.9.9 1.9.8 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 All 110 releases
easy-hotel / admin / includes / post-types / init.php

init.php in Easy Hotel – Powerful Hotel Booking 2.0.4, at admin/includes/post-types/init.php

36 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3 // custom validation filter
4 function eshb_validate_for_required ( $value ) {
5 // return error message if empty
6 if ( empty( $value ) ) {
7 return esc_html__( 'This field is required.', 'easy-hotel' );
8 }
9 };
10
11 include 'accomodation/accomodation.php';
12 include 'session/session.php';
13 include 'service/service.php';
14 include 'booking/booking.php';
15 include 'coupon/coupon.php';
16 include 'booking-request/booking-request.php';
17 include 'payment/payment.php';
18
19
20 add_action( 'plugins_loaded', function(){
21
22
23 // add nonce param to edit url
24 add_filter( 'get_edit_post_link', function( $link, $post_id, $context ) {
25
26 // Check for your custom post type (optional)
27 if ( in_array(get_post_type( $post_id ), ['eshb_booking', 'eshb_payment', 'eshb_coupon', 'eshb_booking_request', 'eshb_service', 'eshb_session']) ) {
28 // Add your custom parameter
29 $nonce_action = ESHB_Helper::generate_secure_nonce_action('eshb_global_nonce_action');
30 $link = add_query_arg( 'nonce', wp_create_nonce($nonce_action), $link );
31 }
32
33 return $link;
34 }, 10, 3 );
35 } );
36