Skip to content
Docs
Get RestroPress

Function

Deprecated functions functions

Updated
On this page

Functions kept for backward compatibility. Use the replacement shown for each one.

18 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_get_fooditem_sales_log()#

Deprecated since 1.3.4.

Returns the legacy sales log stored in the _rpress_sales_log meta of a menu item.

Reads the _rpress_sales_log post meta, newest entry first. Returns the log under sales with the total in number, optionally sliced for pagination.

rpress_get_fooditem_sales_log( $fooditem_id, $paginate = false, $number = 10, $offset = 0 )

Parameters

ParameterTypeDefaultDescription
$fooditem_idintRequiredMenu item ID.
$paginateboolfalseWhether to slice the results using $number and $offset.
$numberint10Number of entries to return when paginating.
$offsetint0Number of entries to skip when paginating.

Returns array|false: Array with number and sales keys, or false when the meta is empty.

Note: Triggers a deprecation notice.

Internal. Defined in includes/deprecated-functions.php, line 31.

rpress_get_file_fooditem_log()#

Deprecated since 1.3.4.

Returns the legacy file download log stored in the _rpress_file_fooditem_log meta of a menu item.

Reads the _rpress_file_fooditem_log post meta, newest entry first. Returns the log under fooditems with the total in number, optionally sliced for pagination.

rpress_get_file_fooditem_log( $fooditem_id, $paginate = false, $number = 10, $offset = 0 )

Parameters

ParameterTypeDefaultDescription
$fooditem_idintRequiredMenu item ID.
$paginateboolfalseWhether to slice the results using $number and $offset.
$numberint10Number of entries to return when paginating.
$offsetint0Number of entries to skip when paginating.

Returns array|false: Array with number and fooditems keys, or false when the meta is empty.

Note: Triggers a deprecation notice.

Internal. Defined in includes/deprecated-functions.php, line 62.

rpress_get_fooditems_of_purchase()#

Deprecated since 1.4. Use rpress_get_payment_meta_fooditems() instead.

Returns the menu items stored in an order's payment meta.

Reads the fooditems entry of the payment meta, loading it with rpress_get_payment_meta() when $payment_meta is not supplied, and unserializes it if needed.

rpress_get_fooditems_of_purchase( $payment_id, $payment_meta = null )

Parameters

ParameterTypeDefaultDescription
$payment_idintRequiredOrder (payment) ID.
$payment_metaarray|nullnullPayment meta array. Fetched from the payment ID when null.

Returns array|false: The menu items array, or false when empty.

Internal. Defined in includes/deprecated-functions.php, line 90.

rpress_get_menu_access_level()#

Deprecated since 1.4.4. Use current_user_can('manage_shop_settings')() instead.

Returns the capability required to access the menu items admin menu.

Filtered through rpress_menu_access_level. Defaults to manage_options.

rpress_get_menu_access_level()

Returns string: Capability name, manage_options by default.

Internal. Defined in includes/deprecated-functions.php, line 111.

rpress_local_taxes_only()#

Deprecated since 1.6. Use no alternatives() instead.

Checks whether the tax_condition setting is set to local taxes only.

Reads tax_condition from the global $rpress_options and compares it to local. Result is filtered through rpress_local_taxes_only.

rpress_local_taxes_only()

Returns bool: True when local taxes only are enabled.

Internal. Defined in includes/deprecated-functions.php, line 125.

rpress_local_tax_opted_in()#

Deprecated since 1.6. Use no alternatives() instead.

Checks whether the customer opted into local taxes in the session.

Reads rpress_local_tax_opt_in from the RestroPress session.

rpress_local_tax_opted_in()

Returns bool: True when the session value is not empty.

Internal. Defined in includes/deprecated-functions.php, line 140.

rpress_taxes_on_prices()#

Deprecated since 1.9. Use no alternatives() instead.

Checks whether the taxes_on_prices setting is present.

Returns whether taxes_on_prices is set in the global $rpress_options, filtered through rpress_taxes_on_prices.

rpress_taxes_on_prices()

Returns bool: Whether taxes are shown on individual prices.

Internal. Defined in includes/deprecated-functions.php, line 154.

rpress_get_cart_amount()#

Deprecated since 1.9. Use rpress_get_cart_subtotal() or rpress_get_cart_total()() instead.

Returns the cart amount with discounts applied and optional taxes.

Starts from rpress_get_cart_subtotal(), subtracts applied discounts (including a discount code posted as rpress-discount), then adds cart tax when taxes are enabled and $add_taxes is true. The result is floored at zero and filtered through rpress_get_cart_amount.

rpress_get_cart_amount( $add_taxes = true, $local_override = false )

Parameters

ParameterTypeDefaultDescription
$add_taxesbooltrueWhether to add taxes when they are enabled.
$local_overrideboolfalsePassed to the rpress_get_cart_amount filter only; not used in the calculation.

Returns float: Cart amount, never below 0.

Internal. Defined in includes/deprecated-functions.php, line 169.

rpress_get_purchase_receipt_template_tags()#

Deprecated since 1.9.

Returns the help text listing the order receipt email template tags.

Builds an HTML string describing tags such as {name}, {price} and {receipt_link}, filtered through rpress_purchase_receipt_template_tags_description.

rpress_get_purchase_receipt_template_tags()

Returns string: HTML help text.

Note: The deprecation is recorded in the docblock only; the body raises no notice.

Internal. Defined in includes/deprecated-functions.php, line 205.

rpress_get_sale_notification_template_tags()#

Deprecated since 1.9.

Returns the help text listing the sale notification email template tags.

Builds an HTML string describing tags such as {name}, {price} and {payment_id}, filtered through rpress_sale_notification_template_tags_description.

rpress_get_sale_notification_template_tags()

Returns string: HTML help text.

Note: The deprecation is recorded in the docblock only; the body raises no notice.

Internal. Defined in includes/deprecated-functions.php, line 234.

rpress_get_email_body_header()#

Deprecated since 2.0.

Returns the opening HTML of the legacy email template.

Captures an html/head/body opening with text direction based on is_rtl(), and fires rpress_email_body_header inside the body.

rpress_get_email_body_header()

Returns string: Header HTML.

Internal. Defined in includes/deprecated-functions.php, line 260.

Deprecated since 2.0.

Returns the closing HTML of the legacy email template.

Fires rpress_email_body_footer, then captures the closing body and html tags.

rpress_get_email_body_footer()

Returns string: Footer HTML.

Internal. Defined in includes/deprecated-functions.php, line 281.

rpress_taxes_after_discounts()#

Deprecated since 2.1. Use none() instead.

Checks whether taxes are calculated after discounts.

True when taxes_after_discounts is set in $rpress_options and taxes are in use. Filtered through rpress_taxes_after_discounts.

rpress_taxes_after_discounts()

Returns bool: Whether taxes are calculated after discounts.

Internal. Defined in includes/deprecated-functions.php, line 301.

rpress_get_success_page_url()#

Deprecated since 2.6. Use rpress_get_success_page_uri()() instead.

Returns the order confirmation page URL.

Wraps rpress_get_success_page_uri() and filters the result through rpress_success_page_url.

rpress_get_success_page_url( $query_string = null )

Parameters

ParameterTypeDefaultDescription
$query_stringstring|nullnullQuery string passed to rpress_get_success_page_uri().

Returns string: Success page URL.

Internal. Defined in includes/deprecated-functions.php, line 316.

rpress_undo_purchase_on_refund()#

Deprecated since 2.5.7. Use RPRESS_Payment->refund()() instead.

Refunds an order through the RPRESS_Payment class.

Creates an RPRESS_Payment for the ID and calls refund(). The status arguments are not used.

rpress_undo_purchase_on_refund( $payment_id, $new_status, $old_status )

Parameters

ParameterTypeDefaultDescription
$payment_idintRequiredOrder (payment) ID.
$new_statusstringRequiredNew order status. Unused.
$old_statusstringRequiredPrevious order status. Unused.

Internal. Defined in includes/deprecated-functions.php, line 331.

rpress_get_earnings_by_date()#

Deprecated since 2.7. Use RPRESS_Payment_Stats()->get_earnings()() instead.

Returns total order earnings for a date range, cached for one hour.

Queries completed (publish, revoked) orders for the year, month, day and hour given, sums _rpress_payment_total and optionally subtracts _rpress_payment_tax. Cached in the rpress_stats_earnings transient. Query args are filtered through rpress_get_earnings_by_date_args.

rpress_get_earnings_by_date( $day = null, $month_num = null, $year = null, $hour = null, $include_taxes = true )

Parameters

ParameterTypeDefaultDescription
$dayint|nullnullDay of month.
$month_numint|nullnullMonth number.
$yearint|nullnullYear.
$hourint|nullnullHour of day.
$include_taxesbooltrueWhether tax is included in the total.

Returns float: Earnings rounded to 2 decimals.

Internal. Defined in includes/deprecated-functions.php, line 348.

rpress_get_sales_by_date()#

Deprecated since 2.7. Use RPRESS_Payment_Stats()->get_sales()() instead.

Returns the number of orders for a date range, cached for one hour.

Counts completed (publish, revoked) orders using WP_Query for the year, month, day and hour given. Cached in the rpress_stats_sales transient. Zero-total orders can be excluded with rpress_sales_by_date_show_free, and args are filtered through rpress_get_sales_by_date_args.

rpress_get_sales_by_date( $day = null, $month_num = null, $year = null, $hour = null )

Parameters

ParameterTypeDefaultDescription
$dayint|nullnullDay of month.
$month_numint|nullnullMonth number.
$yearint|nullnullYear.
$hourint|nullnullHour of day.

Returns int: Order count.

Internal. Defined in includes/deprecated-functions.php, line 413.

rpress_get_paypal_page_style()#

Deprecated since 2.8. Use rpress_get_paypal_image_url() instead.

Returns the PayPal checkout page style setting.

Reads the paypal_page_style option (default PayPal), filtered through rpress_paypal_page_style.

rpress_get_paypal_page_style()

Returns string: Page style name.

Internal. Defined in includes/deprecated-functions.php, line 462.

Was this page helpful?