wpo_wcpdf_check_privs

The WooCommerce PDF Invoices & Packing Slips wpo wcpdf check privs hook.

Description

Parameters (2)

0. $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account (number) => !current_user_can( 'manage_woocommerce_orders' ) && !current_user_can( 'edit_shop_orders' ) && !isset( $_GET['my-account'] )
The current user can manage woocommerce orders current user can edit shop orders isset get my account.
1. $order_ids (unknown)
The order ids.

Usage

To run the hook, copy the example below.
  1. $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account = apply_filters( 'wpo_wcpdf_check_privs', $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account, $order_ids ); 
  2.  
  3. if ( !empty( $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wpo_wcpdf_check_privs callback 
  2. function filter_wpo_wcpdf_check_privs( $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account, $order_ids ) { 
  3. // make filter magic happen here... 
  4. return $current_user_can_manage_woocommerce_orders_current_user_can_edit_shop_orders_isset_get_my_account
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wpo_wcpdf_check_privs', 'filter_wpo_wcpdf_check_privs', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wpo_wcpdf_check_privs', 'filter_wpo_wcpdf_check_privs', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wcpdf-export.php  
  1. if( apply_filters( 'wpo_wcpdf_check_privs', !current_user_can( 'manage_woocommerce_orders' ) && !current_user_can( 'edit_shop_orders' ) && !isset( $_GET['my-account'] ), $order_ids ) ) {