woocommerce_register_post_type_shop_order

The WooCommerce woocommerce register post type shop order hook.

Description

apply_filters( 'woocommerce_register_post_type_shop_order', (callback) $var ); 

Parameters (1)

0. $var — Optional. (callback) => array( 'labels' => array( 'name' => __( 'Orders', 'woocommerce' ), 'singular_name' => _x( 'Order', 'shop_order post type singular name', 'woocommerce' ), 'add_new' => __( 'Add order', 'woocommerce' ), 'add_new_item' => __( 'Add new order', 'woocommerce' ), 'edit' => __( 'Edit', 'woocommerce' ), 'edit_item' => __( 'Edit order', 'woocommerce' ), 'new_item' => __( 'New order', 'woocommerce' ), 'view' => __( 'View order', 'woocommerce' ), 'view_item' => __( 'View order', 'woocommerce' ), 'search_items' => __( 'Search orders', 'woocommerce' ), 'not_found' => __( 'No orders found', 'woocommerce' ), 'not_found_in_trash' => __( 'No orders found in trash', 'woocommerce' ), 'parent' => __( 'Parent orders', 'woocommerce' ), 'menu_name' => _x( 'Orders', 'Admin menu name', 'woocommerce' ), 'filter_items_list' => __( 'Filter orders', 'woocommerce' ), 'items_list_navigation' => __( 'Orders navigation', 'woocommerce' ), 'items_list' => __( 'Orders list', 'woocommerce' ), ), 'description' => __( 'This is where store orders are stored.', 'woocommerce' ), 'public' => false, 'show_ui' => true, 'capability_type' => 'shop_order', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => current_user_can( 'manage_woocommerce' ) ? 'woocommerce' : true, 'hierarchical' => false, 'show_in_nav_menus' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array( 'title', 'comments', 'custom-fields' ), 'has_archive' => false, )
The array.

Usage

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

Defined (1)

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

/includes/class-wc-post-types.php  
  1. apply_filters( 'woocommerce_register_post_type_shop_order',