### Example theme-wrapper.php Implementation
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-loop-theme-wrapper-php
A complete example of a theme-wrapper.php file structure using the $do_wppizza_loop variable.
```php
```
--------------------------------
### Full search.php Example
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-search-search-php
A complete example of a search.php file integrated with WPPizza functionality.
```php
__( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ',
) );
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
```
--------------------------------
### WPPizza Cross-Sells Shortcode Examples
Source: https://docs.wp-pizza.com/developers?section=cross-sells
Examples of using the [wppizza_xsells] shortcode with custom parameters and default settings.
```text
[wppizza_xsells title='some title' max='5' view='3' arrows='1' dots='1' infinite='0' no_additives='1' breakpoints='600:2,400:1']
```
```text
[wppizza_xsells]
```
```text
[wppizza_xsells title='/*set in localization*/' max='/*as set in options*/' view='3' arrows='1' dots='0' infinite='0' no_additives='0' breakpoints='800:2,400:1']
```
--------------------------------
### Define WPPizza Installation Constants
Source: https://docs.wp-pizza.com/developers?section=wppizza_install_constants
Use these constants in wp-config.php to control what data is installed during the initial plugin setup. These settings only affect the installation process and have no effect if set after the plugin is already installed.
```php
define('WPPIZZA_INSTALL_REQUIRED_ONLY', true);
```
```php
define('WPPIZZA_INSTALL_NO_MENU_ITEMS', true);
```
```php
define('WPPIZZA_INSTALL_NO_DEFAULTS', true);
```
```php
define('WPPIZZA_INSTALL_IGNORE_REQUIREMENTS ', true);
```
--------------------------------
### Display Configuration Examples
Source: https://docs.wp-pizza.com/by-category
Examples of modifying the display output using attributes like noheader, showadditives, and style.
```text
[wppizza category='pizza' noheader='1']
```
```text
[wppizza category='pizza' showadditives='0']
```
```text
[wppizza category='pasta, pizza' style='grid']
```
--------------------------------
### Install Required Data Only
Source: https://docs.wp-pizza.com/wppizza_install_constants
Limits installation to essential pages like the order and root menu pages, excluding default items and categories.
```php
define('WPPIZZA_INSTALL_REQUIRED_ONLY', true);
```
--------------------------------
### Default Cross-Sell Shortcode Usage
Source: https://docs.wp-pizza.com/cross-sells
Example of the default shortcode usage and its equivalent expanded configuration.
```text
[wppizza_xsells]
```
```text
[wppizza_xsells title='/*set in localization*/' max='/*as set in options*/' view='3' arrows='1' dots='0' infinite='0' no_additives='0' breakpoints='800:2,400:1']
```
--------------------------------
### Implement WPPizza Breadcrumbs
Source: https://docs.wp-pizza.com/developers?section=global-wppizza-functions
Example of integrating breadcrumbs into the WPPizza loop using a filter hook.
```php
//only the first parameter is really needed for the breadcrumbs here, but for completeness all 6 are listed below
add_filter('wppizza_loop_before_menu_items', 'prefix_add_wppizza_breadcrumbs', 10, 6);
function prefix_add_wppizza_breadcrumbs($markup, $txt, $additives, $category, $max_num_pages, $post_count){
// default arguments are as follows
$args = array();
$args['here_text'] = __( 'You are currently here!' );
$args['home_link'] = home_url('/');
$args['home_text'] = __( 'Home' );
$args['link_before'] = '';
$args['link_after'] = '';
$args['link_attr'] = ' rel="v:url" property="v:title"';
$args['delimiter'] = ' » '; // Delimiter between crumbs
$args['before'] = ''; // Tag before the current crumb
$args['after'] = '';// Tag after the current crumb
// output the breadcrumbs according to arguments
$markup['breadcrumbs'] = wppizza_breadcrumbs($args);
return $markup;
}
```
--------------------------------
### Configure Cross-Sells with Shortcode Attributes
Source: https://docs.wp-pizza.com/cross-sells
Example of a fully configured shortcode with custom display settings and responsive breakpoints.
```text
[wppizza_xsells title='some title' max='5' view='3' arrows='1' dots='1' infinite='0' no_additives='1' breakpoints='600:2,400:1']
```
--------------------------------
### Display Order Info Shortcode Examples
Source: https://docs.wp-pizza.com/order-info
Various configurations for the wppizza orderinfo shortcode to display delivery and discount information.
```shortcode
[wppizza type='orderinfo']
```
```shortcode
[wppizza type='orderinfo' info='discounts' width='80%' class='my-class']
```
```shortcode
[wppizza type='orderinfo' info='deliveries' width='350px' class='some-class']
```
--------------------------------
### Define WPPIZZA_TRANSACTION_GET_PREFIX
Source: https://docs.wp-pizza.com/wppizza_transaction_constants
Sets the GET parameter prefix for successful transactions. Defaults to 'wpptx'.
```php
/* wpptx used as default */
define('WPPIZZA_TRANSACTION_GET_PREFIX', 'wpptx');
```
--------------------------------
### Item Inclusion and Exclusion Examples
Source: https://docs.wp-pizza.com/by-category
Examples of filtering specific menu items by their IDs.
```text
[wppizza category='pizza' exclude='6,5,8']
```
```text
[wppizza category='pasta, pizza' include='10,11,12']
```
--------------------------------
### Display WPPizza Navigation
Source: https://docs.wp-pizza.com/shortcodes?section=widgets
Use this shortcode for the navigation widget, which is only useful when using Install Option 2.
```text
[wppizza type=’navigation’]
```
--------------------------------
### Display WPPizza Category Navigation
Source: https://docs.wp-pizza.com/shortcodes?section=navigation
Examples of using the navigation shortcode to render category lists or dropdowns with various configuration options.
```shortcode
[wppizza type='navigation' title='My Title']
```
```shortcode
[wppizza type='navigation' parent='pizza' exclude='114, 115' as_dropdown='1']
```
--------------------------------
### WPPizza Shortcode Examples
Source: https://docs.wp-pizza.com/shortcodes?section=by-category
Various configurations for the [wppizza] shortcode to filter menu items by category, exclude specific items, or toggle display settings.
```text
[wppizza]
```
```text
[wppizza category='pizza']
```
```text
[wppizza category='pizza,snacks']
```
```text
[wppizza category='!all']
```
```text
[wppizza category='!all,-pizza,-pasta']
```
```text
[wppizza category='pizza' noheader='1']
```
```text
[wppizza category='pizza' showadditives='0']
```
```text
[wppizza category='pizza' exclude='6,5,8']
```
```text
[wppizza category='pasta, pizza' include='10,11,12']
```
--------------------------------
### Loading jQuery UI CSS
Source: https://docs.wp-pizza.com/faqs?section=removing-version-numbers
Example of a hardcoded URL for loading a jQuery UI theme stylesheet.
```text
//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css
```
--------------------------------
### Category Filtering Examples
Source: https://docs.wp-pizza.com/by-category
Examples of filtering menu items by specific category slugs or excluding categories.
```text
[wppizza category='pizza']
```
```text
[wppizza category='pizza,snacks']
```
```text
[wppizza category='!all']
```
```text
[wppizza category='!all,-pizza,-pasta']
```
--------------------------------
### Display WPPizza Order Settings Option
Source: https://docs.wp-pizza.com/plugin-options
Outputs the raw value of the pickup preparation time configured in the order settings.
```shortcode
[wppizza type='options' page='order_settings' parameter='order_pickup_preparation_time']
```
--------------------------------
### Disable All Default Installations
Source: https://docs.wp-pizza.com/wppizza_install_constants
Prevents all default data and required pages from being installed, requiring manual configuration of pages and shortcodes.
```php
define('WPPIZZA_INSTALL_NO_DEFAULTS', true);
```
--------------------------------
### Formatted Order Result Example
Source: https://docs.wp-pizza.com/function-wppizza_get_orders
Example of an order result set when class_idents is set to true, showing the added class_ident parameter.
```php
/*
as above example, but with class-indent added to each order parameter
you could use in any outputs for consistent class names (perhaps adding a distinct prefix to each class name as well)
so the order date would now return somthing like this
*/
[orders] => Array
(
[1_623] => Array
(
............
[ordervars] => Array
(
[order_date] => Array
(
[label] => Order Date :
[value] => 2018-05-15 00:48:08
[value_formatted] => May 15, 2018 12:48 am
[class_ident] => order-date //this parameter is now added to each one
)
............
)
............
)
[1_623] => Array
(
/* second order */
)
///etc
)
```
--------------------------------
### Define WPPizza Transaction GET Constants
Source: https://docs.wp-pizza.com/developers?section=wppizza_transaction_constants
Use these definitions in wp-config.php to override default transaction GET parameters if conflicts occur with other plugins.
```php
/* wpptx used as default */
define('WPPIZZA_TRANSACTION_GET_PREFIX', 'wpptx');
```
```php
/* wppcltx used as default */
define('WPPIZZA_TRANSACTION_CANCEL_PREFIX', 'wppcltx');
```
--------------------------------
### Accept an order programmatically
Source: https://docs.wp-pizza.com/developers?section=unconfirmed-orders
Uses the init hook to process incoming order requests, verify the order status, and execute the order confirmation process.
```php
add_action('init', 'myprefix_accept_order');
/*******************************************************
*
* accept an order
* typically done by some script in the backend sending
* some post or get vars
* YOU SHOULD ADD SOME MORE VERIFICATION HERE
* THE BELOW IS JUST A SKELETON
******************************************************/
function myprefix_accept_order(){
/*
a simple check that something was received
AGAIN, YOU REALLY SHOULD ADD MORE VERIFICATION HERE
*/
if(empty($_REQUEST)){return;}
/* parameters received, sanitised */
$parameters = wppizza_sanitize_post_vars($_REQUEST);
/* we assume $parameters['id'] is the order id */
$order_id = $parameters['id'];
/*
check that received id matches an unconfirmed order
by trying to get an unconfirmed order by order id and UNCONFIRMED status
*/
$columns = array();
$columns['id'] = array('data' => $order_id, 'operator' => '=');
$columns['payment_status'] = array('data' => 'UNCONFIRMED', 'operator' => '=');
$order = wppizza_get_order_by_columns($columns);
/*
bail if order not found
*/
if(empty($order)){return;}
/*******
assuming all is good -
now execute the previously unconfirmed but now confirmed order
sending emails , setting to completed etc etc
********/
$transaction_id = $order['sections']['ordervars']['transaction_id']['value'] ;//use tx id we have set previously
$transaction_details = $parameters;// capture tx detals
$transaction_errors = false;// there are no errors that can have happened (or script should have bailed earlier already)
$class_name = 'some_identifier';// for logging, use __CLASS__ if used in calss, else some arbitrary string
$check_user_id = false;// do not try and match user id as this script is called from somewhere else , not related to the user at this time)
$custom_update_columns = false;// no additional column update required (unless you want to, check wppizza_order_execute_ipn as to how )
$unconfirmed = false;// false as we want to complete an order that's already set to unconfirmed
/*
now send normal emails etc etc
*/
$complete_order = wppizza_order_execute_ipn($order, $transaction_id, $transaction_details, $transaction_errors, $class_name, $custom_update_columns, $unconfirmed );
return;
}
```
--------------------------------
### Skip Default Menu Items
Source: https://docs.wp-pizza.com/wppizza_install_constants
Prevents the installation of default menu items and categories.
```php
define('WPPIZZA_INSTALL_NO_MENU_ITEMS', true);
```
--------------------------------
### Querying WordPress Scripts
Source: https://docs.wp-pizza.com/faqs?section=removing-version-numbers
Example of how to query a specific script component within WordPress.
```php
$ui = $wp_scripts->query('jquery-ui-spinner');
```
--------------------------------
### Display WPPizza Plugin Options via Shortcode
Source: https://docs.wp-pizza.com/author/super_admin_v3x
Use these shortcodes to output specific string-based plugin settings directly into page content.
```text
[wppizza type='options' page='localization' parameter='common_label_order_order_id']
```
```text
[wppizza type='options' page='order_settings' parameter='order_pickup_preparation_time']
```
--------------------------------
### Define WPPIZZA_TRANSACTION_CANCEL_PREFIX
Source: https://docs.wp-pizza.com/wppizza_transaction_constants
Sets the GET parameter prefix for cancelled transactions. Defaults to 'wppcltx'.
```php
/* wppcltx used as default */
define('WPPIZZA_TRANSACTION_CANCEL_PREFIX', 'wppcltx');
```
--------------------------------
### Filter Minicart Markup
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-cart-minicart-php
Example of using the wppizza_filter_minicart_widget_markup filter to modify the minicart HTML structure.
```php
add_filter('wppizza_filter_minicart_widget_markup', 'prefix_filter_minicart_container_markup');
function prefix_filter_minicart_container_markup($markup){
/*
notes:
use print_r($markup) to view array keys with their respective markup
use print_r($atts) to view attributes set
use global $wppizza_options; to access all options/settings/localization strings etc set in the plugin
*/
/* example: adding a paragraph AFTER cart container div element using standard php concatenation */
$markup['_div'] .= '
more text after div
';
/* example: adding a paragraph BEFORE cart container div element using standard php concatenation */
$markup['div_'] = '
more text before div
' . $markup['div_'];
/* example: adding a paragraph AFTER cart container div element using wppizza array_splice helper function */
$splice_after['myprefix_paragraph'] = '
more text after div
';
$markup = wppizza_array_splice($markup, $splice_after, '_div' );
/* example: adding a paragraph BEFORE cart container div element using wppizza array_splice helper function */
$splice_before['myprefix_paragraph'] = '
more text buttons div
';
$markup = wppizza_array_splice($markup, $splice_before, 'div_' , true);
/* example: using actions of another plugin that by default outputs html to add it after the container wrapper div */
ob_start(); # start buffering
do_action('other_plugin_output'); # run action of other plugin that outputs things
$buffer= ob_get_contents(); # capture buffer in variable
ob_end_clean(); # clean buffer
$markup['_div'] = $markup['_div'] . $buffer; # add buffered output after end of wrapper
return $markup;
}
```
--------------------------------
### Configure Image Settings
Source: https://docs.wp-pizza.com/shortcodes?section=by-category
Toggles Lightbox functionality and placeholder image display for menu items.
```shortcode
[wppizza category='pasta' image_prettyphoto='0']
```
```shortcode
[wppizza category='pasta' image_placeholder='0']
```
--------------------------------
### Full WPPizza Single Item Template
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-single-single-php
Complete template file for rendering WPPizza single posts, replacing standard theme post display logic.
```php
```
--------------------------------
### Registering a WPPizza Order Page Action
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-pages-page-order-php
Use this pattern to hook into the order page process. Do not output or echo content directly within the function; use filters for outputting elements.
```php
add_action('wppizza_orderpage', 'prefix_orderpage_myaction');
function prefix_orderpage_myaction($order_results){
/* note: use print_r($order_results) to view order parameters */
/*
# run your code/action
*/
/* do not output/echo anything - use the filter above instead if you need to*/
return;
}
```
--------------------------------
### Custom parameter link format
Source: https://docs.wp-pizza.com/set-pickup-delivery-using-link
Example of how links should be formatted when using custom constants defined in wp-config.php.
```text
&x4delivery
&x4pickup
```
--------------------------------
### [wppizza_xsells]
Source: https://docs.wp-pizza.com/developers?section=cross-sells
Shortcode to render cross-sell items. Parameters allow customization of the display, including title, result limits, and responsive breakpoints.
```APIDOC
## [wppizza_xsells]
### Description
Displays cross-sell items on a page or post. The shortcode supports various attributes to control the number of items, navigation elements, and responsive behavior.
### Parameters
- **title** (string) - Optional - Label above Cross Sells.
- **max** (integer) - Optional - Maximum number of x-sells results to retrieve.
- **view** (integer) - Optional - Number of cross sells / cross sells width to be displayed in initial view.
- **arrows** (bool) - Optional - Enable to display navigational left/right arrows (0|1).
- **dots** (bool) - Optional - Enable to display navigational dots (0|1).
- **infinite** (bool) - Optional - Enable for infinite scrolling/swiping (0|1).
- **no_additives** (bool) - Optional - Enable to suppress additives display (0|1).
- **breakpoints** (string) - Optional - Set responsive breakpoints (e.g., '800:2,400:1').
- **Exclude from posts/pages** (string) - Optional - Comma separated integers of pages/posts to exclude the widget from.
### Usage Example
[wppizza_xsells title='some title' max='5' view='3' arrows='1' dots='1' infinite='0' no_additives='1' breakpoints='600:2,400:1']
```
--------------------------------
### Broken jQuery UI CSS URL
Source: https://docs.wp-pizza.com/faqs?section=removing-version-numbers
Example of a malformed URL resulting from the removal of version numbers.
```text
//ajax.googleapis.com/ajax/libs/jqueryui//themes/smoothness/jquery-ui.min.css
```
--------------------------------
### Available PDF format configurations
Source: https://docs.wp-pizza.com/developers?section=pdf-invoices
A reference list of standard paper sizes and their suggested margin and font size configurations.
```php
// A Format
$format['A3'] = array('label' => 'A3', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10, 10));
// $format['A4'] = array('label' => 'A4', 'page_margin' => array(0.5, 0.5), 'font_size' => array(8, 8));/* inbuilt into plugin */
$format['A5'] = array('label' => 'A5', 'page_margin' => array(0.5, 0.5), 'font_size' => array(7, 7));
$format['A6'] = array('label' => 'A6', 'page_margin' => array(0.5, 0.5), 'font_size' => array(6, 6),);
$format['A7'] = array('label' => 'A7', 'page_margin' => array(0.5, 0.5), 'font_size' => array(4.5, 4.5),);
$format['A8'] = array('label' => 'A8', 'page_margin' => array(0.5, 0.5), 'font_size' => array(3, 3),);
$format['A9'] = array('label' => 'A9', 'page_margin' => array(0.5, 0.5), 'font_size' => array(2, 2),);
$format['A10'] = array('label' => 'A10', 'page_margin' => array(0.5, 0.5), 'font_size' => array(1.5, 1.5),);
// B Format
$format['B3'] = array('label' => 'B3', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10, 10));
$format['B4'] = array('label' => 'B4', 'page_margin' => array(0.5, 0.5), 'font_size' => array(8, 8));
$format['B5'] = array('label' => 'B5', 'page_margin' => array(0.5, 0.5), 'font_size' => array(7, 7),);
$format['B6'] = array('label' => 'B6', 'page_margin' => array(0.5, 0.5), 'font_size' => array(6.5, 6.5),);
$format['B7'] = array('label' => 'B7', 'page_margin' => array(0.5, 0.5), 'font_size' => array(4.5, 4.5),);
$format['B8'] = array('label' => 'B8', 'page_margin' => array(0.5, 0.5), 'font_size' => array(3, 3),);
$format['B9'] = array('label' => 'B9', 'page_margin' => array(0.5, 0.5), 'font_size' => array(2, 2),);
$format['B10'] = array('label' => 'B10','page_margin' => array(0.5, 0.5), 'font_size' => array(1.5, 1.5),);
// C Format
$format['C3'] = array('label' => 'C3', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10, 10));
$format['C4'] = array('label' => 'C4', 'page_margin' => array(0.5, 0.5), 'font_size' => array(8, 8));
$format['C5'] = array('label' => 'C5', 'page_margin' => array(0.5, 0.5), 'font_size' => array(7, 7),);
$format['C6'] = array('label' => 'C6', 'page_margin' => array(0.5, 0.5), 'font_size' => array(6.5, 6.5),);
$format['C7'] = array('label' => 'C7', 'page_margin' => array(0.5, 0.5), 'font_size' => array(4.5, 4.5),);
$format['C8'] = array('label' => 'C8', 'page_margin' => array(0.5, 0.5), 'font_size' => array(3, 3),);
$format['C9'] = array('label' => 'C9', 'page_margin' => array(0.5, 0.5), 'font_size' => array(2, 2),);
$format['C10'] = array('label' => 'C10', 'page_margin' => array(0.5, 0.5), 'font_size' => array(1.5, 1.5),);
// Misc Standards
// $format['letter'] = array('label' => 'Letter', 'page_margin' => array(0.5, 0.5), 'font_size' => array(8, 8));/* inbuilt into plugin */
// $format['legal'] = array('label' => 'Legal', 'page_margin' => array(0.5, 0.5), 'font_size' => array(8, 8));/* inbuilt into plugin */
$format['ledger'] = array('label' => 'Ledger', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10, 10));
$format['tabloid'] = array('label' => 'Tabloid', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10, 10));
$format['executive'] = array('label' => 'Executive', 'page_margin' => array(0.5, 0.5), 'font_size' => array(10.5, 10.5));
$format['folio'] = array('label' => 'Folio');
// Misc Fixed Sizes
$format['8.5x11'] = array('label' => '8.5x11', 'page_margin' => array(0.5, 0.5),);
$format['8.5x14'] = array('label' => '8.5x14', 'page_margin' => array(0.5, 0.5),);
$format['11x17'] = array('label' => '11x17', 'page_margin' => array(0.5, 0.5),);
```
--------------------------------
### Default Shortcode Usage
Source: https://docs.wp-pizza.com/by-category
Displays menu items from the first non-empty category defined in WPPizza settings.
```text
[wppizza]
```
--------------------------------
### Filter Report Query
Source: https://docs.wp-pizza.com/developers?section=create-your-own-sales-report
Example of using the wppizza_filter_report_query filter to modify the SQL query for sales reports.
```php
add_filter('wppizza_filter_report_query', 'my_prefix_my_query', 10, 3);
function my_prefix_my_query($ordersQuery, $wpdbPrefix, $oQuery){
/*
maybe not the most useful example but to keep it simple -
look at the table structure of the wppizza_orders table to create a query appropriate to your scenario
*/
$ordersQuery = str_ireplace("WHERE", "WHERE wp_user_id = '5' AND ", $ordersQuery);/* keep the query as is, but only query sales from user with user_id 5 */
return $ordersQuery;
}
```
--------------------------------
### init (Order Acceptance)
Source: https://docs.wp-pizza.com/developers?section=unconfirmed-orders
An action hook used to programmatically accept and process unconfirmed orders.
```APIDOC
## init (Order Acceptance)
### Description
An action hook used to trigger custom logic for accepting an order. This is typically used in backend scripts to process payment notifications or external order confirmations.
### Example
```php
add_action('init', 'myprefix_accept_order');
function myprefix_accept_order(){
if(empty($_REQUEST)){return;}
$parameters = wppizza_sanitize_post_vars($_REQUEST);
$order_id = $parameters['id'];
$columns = array('id' => array('data' => $order_id, 'operator' => '='), 'payment_status' => array('data' => 'UNCONFIRMED', 'operator' => '='));
$order = wppizza_get_order_by_columns($columns);
if(empty($order)){return;}
$complete_order = wppizza_order_execute_ipn($order, $transaction_id, $transaction_details, $transaction_errors, $class_name, $custom_update_columns, false);
}
```
```
--------------------------------
### Dynamic jQuery UI CSS URL
Source: https://docs.wp-pizza.com/faqs?section=removing-version-numbers
Example of constructing a CSS URL using the script version property.
```php
//ajax.googleapis.com/ajax/libs/jqueryui/" . $ui->ver . "/themes/smoothness/jquery-ui.min.css
```
--------------------------------
### [wppizza type='additives']
Source: https://docs.wp-pizza.com/shortcodes?section=additives
Displays all additives configured in the WPPizza settings.
```APIDOC
## [wppizza type='additives']
### Description
Displays all additives as configured in the WPPizza Additives settings menu.
### Parameters
- **type** (string) - Required - Must be set to 'additives'.
- **class** (string) - Optional - A valid CSS class name to be added to the widget container.
### Usage Examples
Display all additives:
[wppizza type='additives']
Display all additives with a custom CSS class:
[wppizza type='additives' class='my-class']
```
--------------------------------
### Display Order Info Widget
Source: https://docs.wp-pizza.com/category/shortcodes/widgets
Displays delivery and discount settings as a list. Allows customization of width and container class.
```shortcode
[wppizza type='orderinfo']
```
--------------------------------
### Filter Thumbnail CSS Classes
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-loop-posts-thumbnail-php
Example of using the wppizza_filter_post_thumbnail_class filter to add custom CSS classes to the thumbnail wrapper.
```php
add_filter('wppizza_filter_post_thumbnail_class', 'prefix_filter_post_thumbnail_class', 10 ,2);
function prefix_filter_post_thumbnail_class($classes, $post_data){
/* adding your own class name */
$classes[] ='my-class';
return $classes;
}
```
--------------------------------
### Retrieve WPPizza Menu Items
Source: https://docs.wp-pizza.com/developers?section=global-wppizza-functions
Fetches all menu items configured in WPPizza settings as an array of objects.
```php
$wppizza_menu_items = wppizza_get_menu_items();
print_r($wppizza_menu_items ); /* print array of wppizza menu items*/
```
--------------------------------
### Execute Custom Logic with wppizza_profile_update Action
Source: https://docs.wp-pizza.com/developers?section=wppizza-markup-global-profile-update-php
Use this action to run custom code when the profile update section is displayed. Do not output or echo content directly from this action.
```php
add_action('wppizza_profile_update', 'prefix_profile_update_myaction');
function prefix_profile_update_myaction(){
/*
# run your code/action
*/
/* do not output/echo anything - use the filter above instead if you need to*/
return;
}
```
--------------------------------
### Enable discounts for credit card gateways
Source: https://docs.wp-pizza.com/developers?section=gateway-filter-frontend
Use the wppizza_filter_gateway_objects filter to manually allow discounts on gateways that are restricted by default.
```php
add_filter('wppizza_filter_gateway_objects', 'myprefix_filter_gateway_objects');
function myprefix_filter_gateway_objects($obj){
/* 5 EUR/USD/whatever discount */
$obj->MOLLIE->discounts['fixed'] = 5;
/* and/or for 5 percent instead */
$obj->MOLLIE->discounts['percent'] = 5;
return $obj;
}
```