Skip to content

Instantly share code, notes, and snippets.

View fivestarplugins's full-sized avatar

fivestarplugins

View GitHub Profile
@fivestarplugins
fivestarplugins / rtb-delete-status-example.php
Last active August 15, 2024 14:02
Example of how to delete an existing status
<?php
// An example of how to delete an existing booking status
// in the Five Star Restaurant Reservations plugin.
// You would place this somewhere like your child
// theme's functions.php file.
// Note that, if using this on a default status, this
// does not remove the entry for the status from the bulk
// action dropdown on the bookings overview admin screen.
add_filter( 'rtb_post_statuses_args', 'rtb_delete_status' );
<?php
// An example of how to modify the availble
// options in the Early Bookings setting.
add_filter( 'rtb_setting_early_booking_options', 'change_early_bookings_options' );
function change_early_bookings_options( $list ) {
$list['10'] = __( 'From 10 days in advance', 'restaurant-reservations' );
$list['75'] = __( 'From 75 days in advance', 'restaurant-reservations' );
@fivestarplugins
fivestarplugins / rtb-add-time-interval-options.php
Created July 4, 2023 15:47
Example of how to add options to the Time Interval setting in the Five Star Restaurant Reservations plugin.
<?php
// An example of how to add to the availble
// options in the Time Interval setting.
function add_time_interval_options( $time_options ) {
$time_options['45'] = __( 'Every 45 minutes', 'restaurant-reservations' );
$time_options['150'] = __( 'Every 150 minutes', 'restaurant-reservations' );
<?php
// An example of how to modify the availble
// options in the Late Bookings setting.
add_filter( 'rtb_setting_late_booking_options', 'change_late_bookings_options' );
function change_late_bookings_options( $list ) {
// Minutes equivalent to 2 hours
$list['120'] = __( 'At least 2 hours in advance', 'restaurant-reservations' );
<?php
// An example of how to add a new "Paid" booking status
// in the Five Star Restaurant Reservations plugin.
// You would place this somewhere like your
// child theme's functions.php file.
add_filter( 'rtb_post_statuses_args', 'rtb_new_status' );
function rtb_new_status( $booking_statuses ) {
@fivestarplugins
fivestarplugins / fdm_order_statuses_example.php
Created February 9, 2023 20:53
Example of how to use the fdm_order_statuses filter
// Example of how to use the fdm_order_statuses filter to add a custom order status called "Quality Check" in the Five Star Restaurant Menu plugin.
// In this example, the slug of the new status is fdm_order_quality_check.
// The value (90) is used to fill in the tracking graphic.
// The label is the name of the status as you want it to appear on your site.
function add_quality_check_status( $order_statuses ) {
$order_statuses['fdm_order_quality_check'] = array(
'label' => 'Quality Check',
'value' => 90,
@fivestarplugins
fivestarplugins / rtb_booking_submit_success_redirect filter_1.php
Last active October 21, 2020 19:24
Example code/use of the rtb_booking_submit_success_redirect filter
function sample_function_name($current_redirect_location, $booking_status, $booking_data) {
// code...
return $current_redirect_location;
}
add_filter( 'rtb_booking_submit_success_redirect', 'sample_function_name' );