woocommerce_register_post_type_shop_webhook

The WooCommerce woocommerce register post type shop webhook hook.

Description

apply_filters( 'woocommerce_register_post_type_shop_webhook', (callback) $array ); 

Parameters (1)

0. $array — Optional. (callback) => array( 'labels' => array( 'name' => __( 'Webhooks', 'woocommerce' ), 'singular_name' => __( 'Webhook', 'woocommerce' ), 'menu_name' => _x( 'Webhooks', 'Admin menu name', 'woocommerce' ), 'add_new' => __( 'Add webhook', 'woocommerce' ), 'add_new_item' => __( 'Add new webhook', 'woocommerce' ), 'edit' => __( 'Edit', 'woocommerce' ), 'edit_item' => __( 'Edit webhook', 'woocommerce' ), 'new_item' => __( 'New webhook', 'woocommerce' ), 'view' => __( 'View webhooks', 'woocommerce' ), 'view_item' => __( 'View webhook', 'woocommerce' ), 'search_items' => __( 'Search webhooks', 'woocommerce' ), 'not_found' => __( 'No webhooks found', 'woocommerce' ), 'not_found_in_trash' => __( 'No webhooks found in trash', 'woocommerce' ), 'parent' => __( 'Parent webhook', 'woocommerce' ), ), 'public' => false, 'show_ui' => true, 'capability_type' => 'shop_webhook', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => false, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => false, 'show_in_nav_menus' => false, 'show_in_admin_bar' => false, )
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'woocommerce_register_post_type_shop_webhook', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  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_webhook callback 
  2. function filter_woocommerce_register_post_type_shop_webhook( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_register_post_type_shop_webhook', 'filter_woocommerce_register_post_type_shop_webhook', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_register_post_type_shop_webhook', 'filter_woocommerce_register_post_type_shop_webhook', 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_webhook',