Skip to content

Instantly share code, notes, and snippets.

@NateWr
Last active January 23, 2019 08:54
Show Gist options
  • Save NateWr/3303e8750ac2a309a48e to your computer and use it in GitHub Desktop.
Save NateWr/3303e8750ac2a309a48e to your computer and use it in GitHub Desktop.
Customize the "Book a Form" text in Restaurant Reservations
<?php
/**
* Plugin Name: Custom Legend for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Change the legend text of the booking form to Request an Appointment
* 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;
/**
* Modify the legend for the reservation fieldset
*/
if ( !function_exists( 'rtb_custom_legend' ) ) {
add_filter( 'rtb_booking_form_fields', 'rtb_custom_legend', 10, 2 );
function rtb_custom_legend( $fields, $request ) {
$fields['reservation']['legend'] = __( 'Request an Appointment', RTB_TEXTDOMAIN );
return $fields;
}
} // endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment