Last active
August 29, 2015 14:10
-
-
Save NateWr/b080f5f3580acb19a3d0 to your computer and use it in GitHub Desktop.
Add options to block bookings 2, 3 or 4 days in advance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Custom Late Bookings Options for Restaurant Reservations | |
* Plugin URI: http://themeofthecrop.com | |
* Description: Add options to block bookings 2, 3 or 4 days in advance in the Restaurant Reservations plugin. | |
* Version: 0.0.1 | |
* Author: Theme of the Crop | |
* Author URI: http://themeofthecrop.com | |
* License: GNU General Public License v2.0 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* | |
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU | |
* General Public License as published by the Free Software Foundation; either version 2 of the License, | |
* or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | |
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
* | |
* You should have received a copy of the GNU General Public License along with this program; if not, write | |
* to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) | |
exit; | |
/** | |
* Add a new Time Interval option to the booking schedule settings in | |
* Restaurant Reservations by modifying the settings page array. | |
*/ | |
if ( !function_exists( 'rtb_custom_late_bookings_options' ) ) { | |
add_filter( 'rtb_settings_page', 'rtb_custom_late_bookings_options' ); | |
function rtb_custom_late_bookings_options( $sap ) { | |
$sap->pages['rtb-settings']->sections['rtb-schedule']->settings['late-bookings']->options['2880'] = __( 'At least 2 days in advance', RTB_TEXTDOMAIN ); | |
$sap->pages['rtb-settings']->sections['rtb-schedule']->settings['late-bookings']->options['4320'] = __( 'At least 3 days in advance', RTB_TEXTDOMAIN ); | |
$sap->pages['rtb-settings']->sections['rtb-schedule']->settings['late-bookings']->options['5760'] = __( 'At least 4 days in advance', RTB_TEXTDOMAIN ); | |
return $sap; | |
} | |
} // endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment