Function
Settings, options and store hours functions
On this page
- rpress_text_input()
- rpress_hidden_input()
- rpress_textarea_input()
- rpress_checkbox()
- rpress_select()
- rpress_radio()
- rpress_settings_contextual_help()
- rpress_options_page()
- rpress_get_option()
- rpress_update_option()
- rpress_delete_option()
- rpress_get_settings()
- rpress_register_settings()
- rpress_settings_upsell_nudge()
- rpress_store_hours_callback()
- rpress_settings_sanitize_store_hours_type()
- rpress_holiday_dates_callback()
- rpress_settings_sanitize_holiday_dates_type()
- rpress_get_registered_settings()
- rpress_reorganize_general_settings()
- rpress_map_legacy_settings_section()
- rpress_settings_sanitize()
- rpress_get_registered_settings_types()
- rpress_settings_sanitize_misc_accounting()
- rpress_settings_sanitize_taxes()
- rpress_settings_sanitize_gateways()
- rpress_settings_sanitize_misc_realtime_updates()
- rpress_sanitize_text_field()
- rpress_sanitize_html_class()
- rpress_get_settings_tabs()
- rpress_get_settings_tab_sections()
- rpress_get_registered_settings_sections()
- rpress_get_pages()
- rpress_header_callback()
- rpress_checkbox_callback()
- rpress_multicheck_callback()
- rpress_payment_icons_callback()
- rpress_radio_callback()
- rpress_gateways_callback()
- rpress_gateway_select_callback()
- rpress_text_callback()
- rpress_email_callback()
- rpress_number_callback()
- rpress_textarea_callback()
- rpress_password_callback()
- rpress_missing_callback()
- rpress_select_callback()
- rpress_color_select_callback()
- rpress_rich_editor_callback()
- rpress_upload_callback()
- rpress_color_callback()
- rpress_shop_states_callback()
- rpress_order_notification_settings_callback()
- rpress_descriptive_text_callback()
- rpress_license_key_callback()
- rpress_hook_callback()
- rpress_set_settings_cap()
- rpress_add_setting_tooltip()
- rpress_basic_store_hours_active()
- rpress_get_basic_holidays()
- rpress_is_basic_holiday()
- rpress_get_store_hours_for_date()
Functions that register and read RestroPress settings, plus store hours helpers.
62 functions. Each entry shows the signature, parameters, return value and where it is defined. Functions marked internal are hook callbacks, screen renderers and other plumbing that extensions normally do not call.
rpress_text_input()#
Outputs a labelled text input row for a post meta box field.
Reads the stored value from post meta using the field id unless value is given. The data_type key accepts price, decimal or url to format the value and add a CSS class.
rpress_text_input( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Requires an id and a label; optional keys include value, name, class, style, wrapper_class, description, desc_tip and custom_attributes. Also accepts placeholder, type and data_type. |
Example
add_action( 'rpress_fooditem_editor_top', function () {
rpress_text_input( array(
'id' => '_my_custom_note',
'label' => __( 'Kitchen note', 'my-plugin' ),
) );
} );
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 18.
rpress_hidden_input()#
Outputs a hidden input whose value defaults to the post meta stored under the field id.
rpress_hidden_input( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Uses id (also used as the input name), and optional value and class. |
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 77.
rpress_textarea_input()#
Outputs a labelled textarea row for a post meta box field.
Reads the stored value from post meta using the field id unless value is given. Defaults to 2 rows and 20 columns.
rpress_textarea_input( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Requires an id and a label; optional keys include value, name, class, style, wrapper_class, description, desc_tip and custom_attributes. Also accepts placeholder, rows and cols. |
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 89.
rpress_checkbox()#
Outputs a labelled checkbox row for a post meta box field.
The box is checked when the stored value equals cbvalue, which defaults to yes.
rpress_checkbox( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Requires an id and a label; optional keys include value, name, class, style, wrapper_class, description, desc_tip and custom_attributes. Also accepts cbvalue. |
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 131.
rpress_select()#
Outputs a labelled select row for a post meta box field.
The options key is required and maps option values to labels. The option matching the stored post meta value is selected.
rpress_select( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Requires an id and a label; optional keys include value, name, class, style, wrapper_class, description, desc_tip and custom_attributes. Also requires options, an array of value => label pairs. |
Example
add_action( 'rpress_fooditem_editor_top', function () {
rpress_select( array(
'id' => '_my_spice_level',
'label' => __( 'Spice level', 'my-plugin' ),
'options' => array(
'mild' => __( 'Mild', 'my-plugin' ),
'hot' => __( 'Hot', 'my-plugin' ),
),
) );
} );
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 171.
rpress_radio()#
Outputs a labelled group of radio buttons for a post meta box field.
The options key is required and maps radio values to labels. The option matching the stored post meta value is checked.
rpress_radio( $field )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$field | array | Required | Field definition array. Requires an id and a label; optional keys include value, name, class, style, wrapper_class, description, desc_tip and custom_attributes. Also requires options, an array of value => label pairs. |
Note: Echoes output instead of returning it. Falls back to the global $post when $thepostid is empty, so call it where a post is in scope.
Defined in includes/admin/rp-meta-box-functions.php, line 233.
rpress_settings_contextual_help()#
Adds the help sidebar and tabs to the RestroPress settings screen.
Does nothing unless the current screen is the settings page. Fires the rpress_settings_contextual_help action with the screen object. Hooked to load-restropress_page_rpress-settings.
rpress_settings_contextual_help()
Internal. Defined in includes/admin/settings/contextual-help.php, line 20.
rpress_options_page()#
Renders the RestroPress settings page with its tabs, sections and form.
Resolves the active tab and section from the tab and section query args, maps legacy section slugs, and prints the output. Fires rpress_settings_tab_top, rpress_settings_tab_top_{tab}_{section}, rpress_settings_tab_bottom_{tab}_{section}, rpress_settings_tab_bottom and rpress_settings_after_form_{tab}_{section}.
rpress_options_page()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/display-settings.php, line 21.
rpress_get_option()#
Returns a single RestroPress setting value, or a default when it is empty.
Reads from the global $rpress_options array. Note that any empty value (including 0 and an empty string) is treated as unset and replaced by $default. The result passes through the rpress_get_option and rpress_get_option_{key} filters.
rpress_get_option($key = '', $default = false)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$key | string | '' | Setting key (the id used in the settings array). |
$default | mixed | false | Value returned when the setting is missing or empty. |
Returns mixed: The stored value, or $default when empty.
Example
$min_order = rpress_get_option( 'minimum_order_price', 0 );
Note: Empty values such as 0 or '0' return $default, not the stored value.
Defined in includes/admin/settings/register-settings.php, line 23.
rpress_update_option()#
Saves a single RestroPress setting to the database and the in-memory options array.
Passing an empty $value (empty string, false, 0, null) deletes the key through rpress_delete_option(). The value passes through the rpress_update_option filter before it is stored in the rpress_settings option.
rpress_update_option($key = '', $value = false)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$key | string | '' | Setting key to update. An empty key returns false. |
$value | string|bool|int | false | Value to store. Empty values remove the setting. |
Returns bool: True if the option was updated (or removed), false otherwise, including when the value is unchanged.
Example
rpress_update_option( 'minimum_order_price', '15' );
Note: Empty values delete the setting. Returns false when the stored value is identical to the new one.
Defined in includes/admin/settings/register-settings.php, line 43.
rpress_delete_option()#
Removes a single RestroPress setting from the database and the in-memory options array.
rpress_delete_option($key = '')
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$key | string | '' | Setting key to remove. An empty key returns false. |
Returns bool: True if the option was saved after removal, false if nothing changed or the key was empty.
Example
rpress_delete_option( 'minimum_order_price' );
Defined in includes/admin/settings/register-settings.php, line 77.
rpress_get_settings()#
Returns the full array of RestroPress settings stored in the rpress_settings option.
When the option is empty, it merges the older per-tab options (rpress_settings_general, rpress_settings_gateways, rpress_settings_emails, rpress_settings_styles, rpress_settings_taxes, rpress_settings_misc) into one and saves it. The result passes through the rpress_get_settings filter.
rpress_get_settings()
Returns array: All saved settings keyed by setting id.
Defined in includes/admin/settings/register-settings.php, line 110.
rpress_register_settings()#
Registers the settings sections, fields and the rpress_settings option with the WordPress Settings API.
Skipped during AJAX requests. Each registered setting uses the callback named rpress_{type}_callback, or rpress_missing_callback when that function does not exist. Hooked to admin_init.
rpress_register_settings()
Internal. Defined in includes/admin/settings/register-settings.php, line 132.
rpress_settings_upsell_nudge()#
Returns a one-line HTML notice linking to a paid extension.
The message is escaped and followed by a 'View extension' link that opens in a new tab. Intended only for the case where the related extension is not active.
rpress_settings_upsell_nudge($message, $url = '')
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$message | string | Required | Text describing what the paid extension adds. |
$url | string | '' | Link target. Defaults to the Extensions admin page. |
Returns string: HTML span containing the message and link.
Internal. Defined in includes/admin/settings/register-settings.php, line 216.
rpress_store_hours_callback()#
Renders the weekly store hours grid in the settings screen.
Prints an open time, close time and Closed checkbox for each day, stored under rpress_settings[store_hours][1..7] (1 = Monday, 7 = Sunday). Empty times show the legacy open_time and close_time values.
rpress_store_hours_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; desc is shown beneath the grid. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 235.
rpress_settings_sanitize_store_hours_type()#
Sanitizes the submitted weekly store hours grid.
Keeps only days 1 to 7, sanitizes the open and close strings, and stores closed as '1' when set. Hooked to the rpress_settings_sanitize_store_hours filter.
rpress_settings_sanitize_store_hours_type($value)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$value | mixed | Required | Raw submitted value. |
Returns array: Sanitized hours keyed by day number; empty array if the input is not an array.
Internal. Defined in includes/admin/settings/register-settings.php, line 296.
rpress_holiday_dates_callback()#
Renders the holiday dates field (up to five dates) in the settings screen.
Existing dates are shown as removable chips with hidden rpress_settings[basic_holidays][] inputs, plus a date picker to add more.
rpress_holiday_dates_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; desc is shown beneath the field. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 327.
rpress_settings_sanitize_holiday_dates_type()#
Sanitizes the submitted holiday dates list.
Keeps only unique values in Y-m-d format and stops at five dates. Hooked to the rpress_settings_sanitize_holiday_dates filter.
rpress_settings_sanitize_holiday_dates_type($value)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$value | mixed | Required | Raw submitted value. |
Returns array: List of valid Y-m-d date strings, at most five; empty array if the input is not an array.
Internal. Defined in includes/admin/settings/register-settings.php, line 370.
rpress_get_registered_settings()#
Returns the full definition of all settings, grouped by tab and section.
Applies the filters rpress_settings_general and the other per-tab filters, which extensions use to add fields, then reorganizes the General tab and passes the result through rpress_registered_settings. Field types map to rpress_{type}_callback functions.
rpress_get_registered_settings()
Returns array: Nested array: tab => section => setting id => field definition.
Example
add_filter( 'rpress_settings_general', function ( $settings ) {
$settings['main']['my_option'] = array(
'id' => 'my_option',
'name' => __( 'My option', 'my-plugin' ),
'type' => 'text',
);
return $settings;
} );
Note: Expensive to call repeatedly: it rebuilds the array and runs filters each time.
Defined in includes/admin/settings/register-settings.php, line 389.
rpress_reorganize_general_settings()#
Regroups the General tab fields into the restaurant-operation sections.
Moves fields by id into sections such as store_setup, ordering_rules, service_hours, live_orders, checkout, money_order_numbers, printing and developer_api. Fields in legacy sections are merged into the matching new section; other sections are kept. Returns the original input if nothing could be grouped.
rpress_reorganize_general_settings($settings)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$settings | array | Required | General settings keyed by section. |
Returns array: Regrouped General settings.
Internal. Defined in includes/admin/settings/register-settings.php, line 1688.
rpress_map_legacy_settings_section()#
Maps an old General settings section slug to its current section slug.
Only applies to the general tab. Unknown slugs and empty values are returned unchanged.
rpress_map_legacy_settings_section( $tab, $section )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$tab | string | Required | Settings tab id. |
$section | string | Required | Requested section slug. |
Returns string: The current section slug.
Example
$section = rpress_map_legacy_settings_section( 'general', 'service_options' ); // 'service_hours'
Defined in includes/admin/settings/register-settings.php, line 1832.
rpress_settings_sanitize()#
Sanitizes and merges submitted settings before they are saved to rpress_settings.
The sanitize callback for the option. It merges the input into the existing options, runs the rpress_settings_{tab}_sanitize, rpress_settings_{tab}-{section}_sanitize, rpress_settings_sanitize_{type} and rpress_settings_sanitize filters, removes emptied settings of the saved section, and adds an 'updated' notice.
rpress_settings_sanitize($input = array())
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | array() | Submitted settings. |
Returns array: The complete settings array to store.
Internal. Defined in includes/admin/settings/register-settings.php, line 1863.
rpress_get_registered_settings_types()#
Returns a flat map of setting ids to their field types.
Optionally limited to one tab and section. Used by the sanitize routine to apply type-specific cleanup.
rpress_get_registered_settings_types($filtered_tab = false, $filtered_section = false)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$filtered_tab | bool|string | false | Tab id to limit to, or false for all. |
$filtered_section | bool|string | false | Section id to limit to, or false for all. |
Returns array: Setting id => registered type.
Example
$types = rpress_get_registered_settings_types( 'general', 'checkout' );
Defined in includes/admin/settings/register-settings.php, line 1959.
rpress_settings_sanitize_misc_accounting()#
Flags a pending sequential order number upgrade when sequential numbering is turned on.
Requires the manage_shop_settings capability; otherwise the input is returned untouched. Stores the current time in the rpress_upgrade_sequential option. Hooked to the rpress_settings_gateways-accounting_sanitize filter.
rpress_settings_sanitize_misc_accounting($input)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | Required | Submitted settings. |
Returns array: The unmodified input.
Internal. Defined in includes/admin/settings/register-settings.php, line 1992.
rpress_settings_sanitize_taxes()#
Saves the submitted tax rates table when the Taxes settings are saved.
Requires manage_shop_settings and a posted tax_rates field. Sanitizes the rates and stores them in the rpress_tax_rates option. Hooked to the rpress_settings_taxes_sanitize filter.
rpress_settings_sanitize_taxes($input)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | Required | Submitted settings. |
Returns array: The unmodified input.
Internal. Defined in includes/admin/settings/register-settings.php, line 2014.
rpress_settings_sanitize_gateways()#
Validates the default payment gateway against the enabled gateways on save.
Requires manage_shop_settings. If no gateways are enabled, the default is removed and an error notice is added. If the chosen default is not enabled, it is replaced by the first enabled gateway with an error notice. Hooked to the rpress_settings_gateways_sanitize filter.
rpress_settings_sanitize_gateways($input)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | Required | Submitted settings. |
Returns array: Input with a valid default_gateway.
Internal. Defined in includes/admin/settings/register-settings.php, line 2036.
rpress_settings_sanitize_misc_realtime_updates()#
Sanitizes the Realtime Updates settings on save.
Requires manage_shop_settings. Normalizes the realtime_enabled and realtime_use_tls switches to yes/no, restricts the provider to pusher and the scheme to http/https, sanitizes text, URL and cluster fields, and drops invalid ports (0 or above 65535). Hooked to the rpress_settings_misc-realtime_updates_sanitize filter.
rpress_settings_sanitize_misc_realtime_updates($input)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | Required | Submitted settings. |
Returns array: Sanitized input.
Internal. Defined in includes/admin/settings/register-settings.php, line 2069.
rpress_sanitize_text_field()#
Sanitizes a text setting, keeping a limited set of HTML tags.
Runs wp_kses() with p, span, a, strong, em, br, img, div, ul and li and trims the result. The allowed tags can be changed with the rpress_allowed_html_tags filter. Hooked to rpress_settings_sanitize_text.
rpress_sanitize_text_field($input)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | string | Required | Field value. |
Returns string: Sanitized, trimmed value.
Internal. Defined in includes/admin/settings/register-settings.php, line 2148.
rpress_sanitize_html_class()#
Sanitizes one or more HTML class names.
A string is passed through sanitize_html_class(). An array is sanitized item by item, de-duplicated and joined with spaces.
rpress_sanitize_html_class($class = '')
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string|array | '' | Class name or list of class names. |
Returns string: Sanitized class string. Other input types are returned unchanged.
Example
$class = rpress_sanitize_html_class( array( 'btn', 'btn-primary' ) ); // 'btn btn-primary'
Defined in includes/admin/settings/register-settings.php, line 2199.
rpress_get_settings_tabs()#
Returns the settings tabs shown on the RestroPress settings screen.
Includes Extensions and Licenses only when settings are registered for them. The list passes through the rpress_settings_tabs filter.
rpress_get_settings_tabs()
Returns array: Tab id => label.
Example
add_filter( 'rpress_settings_tabs', function ( $tabs ) {
$tabs['my_tab'] = __( 'My Tab', 'my-plugin' );
return $tabs;
} );
Defined in includes/admin/settings/register-settings.php, line 2215.
rpress_get_settings_tab_sections()#
Returns the sections registered for a settings tab.
rpress_get_settings_tab_sections($tab = false)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$tab | string|false | false | Tab id. |
Returns array: Section id => label; empty array when the tab has none or $tab is false.
Example
$sections = rpress_get_settings_tab_sections( 'general' );
Defined in includes/admin/settings/register-settings.php, line 2240.
rpress_get_registered_settings_sections()#
Returns the sections for every settings tab.
The result is cached in a static variable for the request, so the section filters (rpress_settings_sections_{tab} and rpress_settings_sections) run once.
rpress_get_registered_settings_sections()
Returns array: Tab id => (section id => label).
Defined in includes/admin/settings/register-settings.php, line 2258.
rpress_get_pages()#
Returns published pages as an id => title list for settings dropdowns.
Without $force, it only loads pages on the RestroPress settings screen and otherwise returns just a blank option, to avoid an expensive query.
rpress_get_pages($force = false)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$force | bool | false | Load the pages even when not on the settings screen. |
Returns array: Page ID => title, with a blank first option.
Example
$pages = rpress_get_pages( true );
Defined in includes/admin/settings/register-settings.php, line 2316.
rpress_header_callback()#
Renders a header row in the settings screen.
Outputs only what the rpress_after_setting_output filter adds.
rpress_header_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2339.
rpress_checkbox_callback()#
Renders a checkbox field in the settings screen.
Saved value is read with rpress_get_option(); output passes through rpress_after_setting_output.
rpress_checkbox_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2353.
rpress_multicheck_callback()#
Renders a group of checkboxes in the settings screen.
Uses the field options array and the saved value for each key.
rpress_multicheck_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2407.
rpress_payment_icons_callback()#
Renders the payment method icon checkboxes in the settings screen.
Icon images can be overridden per card with the rpress_accepted_payment_{card}_image filter.
rpress_payment_icons_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2456.
rpress_radio_callback()#
Renders a group of radio buttons in the settings screen.
Uses the field options array.
rpress_radio_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2532.
rpress_gateways_callback()#
Renders the list of payment gateways with an enable checkbox for each in the settings screen.
rpress_gateways_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2580.
rpress_gateway_select_callback()#
Renders a select box of the enabled payment gateways in the settings screen.
rpress_gateway_select_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2628.
rpress_text_callback()#
Renders a text input field in the settings screen.
rpress_text_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2671.
rpress_email_callback()#
Renders an email input field in the settings screen.
rpress_email_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2730.
rpress_number_callback()#
Renders a number input field in the settings screen.
Honours the min, max and step arguments.
rpress_number_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2784.
rpress_textarea_callback()#
Renders a textarea field in the settings screen.
rpress_textarea_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2837.
rpress_password_callback()#
Renders a password input field in the settings screen.
rpress_password_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2876.
rpress_missing_callback()#
Prints a notice that the callback for a setting type does not exist.
Used by rpress_register_settings() when no rpress_{type}_callback function is defined for a field.
rpress_missing_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; id is shown in the message. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2915.
rpress_select_callback()#
Renders a select field in the settings screen.
Uses the field options array.
rpress_select_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 2933.
rpress_color_select_callback()#
Renders a select field of colour options in the settings screen.
Uses the field options array.
rpress_color_select_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3002.
rpress_rich_editor_callback()#
Renders a rich text editor field in the settings screen.
Uses wp_editor() with the field name rpress_settings[{id}]; size sets the number of rows (default 20).
rpress_rich_editor_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3047.
rpress_upload_callback()#
Renders a text field with an upload button for media in the settings screen.
rpress_upload_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3108.
rpress_color_callback()#
Renders a colour picker field in the settings screen.
rpress_color_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3148.
rpress_shop_states_callback()#
Renders a state/region select for the store country in the settings screen.
The list comes from rpress_get_states().
rpress_shop_states_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments registered for the field (such as id, name, desc, std). |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3187.
rpress_order_notification_settings_callback()#
Renders the order notification emails table and its editors in the settings screen.
The table columns can be changed with the rpress_email_setting_columns filter.
rpress_order_notification_settings_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; desc is shown above the table. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3229.
rpress_descriptive_text_callback()#
Renders descriptive text in place of an input in the settings screen.
Prints the desc argument, filtered through rpress_after_setting_output and restricted to a small set of tags.
rpress_descriptive_text_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; desc holds the text. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3528.
rpress_license_key_callback()#
Renders a license key field with its status messages in the settings screen.
Defined only if no function of that name exists. Reads the license status from the option named in options['is_valid_license_option'] and shows expiry, revoked or invalid messages, a nonce field and a Deactivate button when the license is valid.
rpress_license_key_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments, including the options array with is_valid_license_option. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/settings/register-settings.php, line 3562.
rpress_hook_callback()#
Fires an action in place of a settings field.
Runs do_action( 'rpress_' . $args['id'], $args ), letting extensions print their own markup for the field.
rpress_hook_callback($args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$args | array | Required | Setting arguments; id forms the action name. |
Internal. Defined in includes/admin/settings/register-settings.php, line 3715.
rpress_set_settings_cap()#
Returns the capability required to save RestroPress settings.
Hooked to option_page_capability_rpress_settings.
rpress_set_settings_cap()
Returns string: Always manage_shop_settings.
Internal. Defined in includes/admin/settings/register-settings.php, line 3725.
rpress_add_setting_tooltip()#
Appends a help tooltip icon to a setting's output when tooltip arguments are set.
Requires both tooltip_title and tooltip_desc in the field arguments; the icon title combines the two. Hooked to rpress_after_setting_output.
rpress_add_setting_tooltip($html, $args)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$html | string | Required | Field HTML built so far. |
$args | array | Required | Setting arguments. |
Returns string: The HTML, with the tooltip span appended when applicable.
Internal. Defined in includes/admin/settings/register-settings.php, line 3730.
rpress_basic_store_hours_active()#
Checks whether the built-in weekly hours and holidays control the schedule.
Returns false when the Store Timing extension (class RP_StoreTiming_Functions) is loaded. The result can be changed with the rpress_basic_store_hours_active filter.
rpress_basic_store_hours_active()
Returns bool: True when the core hours and holidays apply.
Example
if ( rpress_basic_store_hours_active() ) {
$hours = rpress_get_store_hours_for_date();
}
Defined in includes/rp-store-hours-basic.php, line 27.
rpress_get_basic_holidays()#
Returns the configured holiday dates.
Reads the basic_holidays setting, sanitizes the values and keeps at most five. The list passes through the rpress_basic_holidays filter.
rpress_get_basic_holidays()
Returns array: List of Y-m-d date strings.
Example
$holidays = rpress_get_basic_holidays();
Defined in includes/rp-store-hours-basic.php, line 37.
rpress_is_basic_holiday()#
Checks whether a date is one of the configured basic holidays.
Always false when rpress_basic_store_hours_active() is false.
rpress_is_basic_holiday( $date )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$date | string | Required | Date in Y-m-d format. |
Returns bool: True if the date is a holiday.
Example
if ( rpress_is_basic_holiday( '2026-12-25' ) ) {
// Store is closed.
}
Defined in includes/rp-store-hours-basic.php, line 53.
rpress_get_store_hours_for_date()#
Returns the open time, close time and closed flag for a date.
Uses the per-day store_hours setting (1 = Monday to 7 = Sunday), falling back to the legacy open_time and close_time options. A holiday or a day marked closed sets closed to true unless the enable_always_open setting is on. The result passes through the rpress_store_hours_for_date filter.
rpress_get_store_hours_for_date( $date = '', $skip_holidays = false )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$date | string | '' | Date in Y-m-d format. Empty means today in the site timezone. |
$skip_holidays | bool | false | When true, holidays are ignored and only the weekly schedule is used. |
Returns array: Array with keys open (string), close (string) and closed (bool).
Example
$hours = rpress_get_store_hours_for_date( '2026-12-25' );
if ( $hours['closed'] ) {
// Closed that day.
}
Defined in includes/rp-store-hours-basic.php, line 72.
