1. Home
  2. Restaurants
  3. Advance Customisation
  4. Editing Restaurant Submission Fields

Editing Restaurant Submission Fields

To customize the fields in WP Restaurant Listings use the WordPress hooks (filters) which are explained below.

WP Restaurant Listings’s approach to allowing customization of its forms is to use filters. In WordPress, filters essentially allow you to ‘filter’ data through your own custom php functions which return a different ‘filtered’ result. Any custom code can go in your theme functions.php file.

Editing fields on the frontend

Editing restaurant submission fields are possible via the submit_restaurant_form_fields filter. Adding some code will allow you to edit various fields, or add new ones.

See the below example which demonstrates how to change a field’s label:

View the full list of core fields in this file: https://github.com/wpdrift/WP-Restaurant-Listings/blob/master/includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php

Editing fields in admin

Fields in admin are of similar structure and can be edited using the ‘restaurant_listings_restaurant_listings_data_fields’ filter. Each field takes a label, placeholder, type and description arguments.

See the below example which demonstrates how to change a field’s placeholder:

View the full list of core fields in this file: https://github.com/wpdrift/WP-Restaurant-Listings/blob/master/includes/admin/class-wp-restaurant-listings-writepanels.php

Updated on July 30, 2018

Was this article helpful?

Leave a Comment