woocommerce_new_webhook_data

woocommerce_new_webhook_data

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_new_webhook_data') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-webhooks.php line 193
    			if ( empty( $data['delivery_url'] ) || ! wc_is_valid_url( $data['delivery_url'] ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_webhook_delivery_url', __( 'Webhook delivery URL must be a valid URL starting with http:// or https://', 'woocommerce' ), 400 );
    			}
    
    			$webhook_data = apply_filters( 'woocommerce_new_webhook_data', array(
    				'post_type'     => 'shop_webhook',
    				'post_status'   => 'publish',
    				'ping_status'   => 'closed',
    				'post_author'   => get_current_user_id(),
    				'post_password' => 'webhook_' . wp_generate_password(),
    				'post_title'    => ! empty( $data['name'] ) ? $data['name'] : sprintf( __( 'Webhook created on %s', 'woocommerce' ), (new DateTime('now'))->format( _x( 'M d, Y @ h:i A', 'Webhook created on date parsed by DateTime::format', 'woocommerce' ) ) ),
    
  • /includes/legacy/api/v3/class-wc-api-webhooks.php line 193
    			if ( empty( $data['delivery_url'] ) || ! wc_is_valid_url( $data['delivery_url'] ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_webhook_delivery_url', __( 'Webhook delivery URL must be a valid URL starting with http:// or https://', 'woocommerce' ), 400 );
    			}
    
    			$webhook_data = apply_filters( 'woocommerce_new_webhook_data', array(
    				'post_type'     => 'shop_webhook',
    				'post_status'   => 'publish',
    				'ping_status'   => 'closed',
    				'post_author'   => get_current_user_id(),
    				'post_password' => 'webhook_' . wp_generate_password(),
    				'post_title'    => ! empty( $data['name'] ) ? $data['name'] : sprintf( __( 'Webhook created on %s', 'woocommerce' ), (new DateTime('now'))->format( _x( 'M d, Y @ h:i A', 'Webhook created on date parsed by DateTime::format', 'woocommerce' ) ) ),