woocommerce_page_wc-addons_connection_error

woocommerce_page_wc-addons_connection_error

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.9.5

do_action('woocommerce_page_wc-addons_connection_error') is found 3 times:

  • /includes/admin/class-wc-admin-marketplace-promotions.php line 154
    			 * Allows connection error to be handled.
    			 *
    			 * @since 8.7
    			 */
    			do_action( 'woocommerce_page_wc-addons_connection_error', $raw_promotions->get_error_message() );
    		}
    
    		$response_code = (int) wp_remote_retrieve_response_code( $raw_promotions );
    		if ( 200 !== $response_code ) {
    			/**
    			 * Allows connection error to be handled.
    
  • /includes/admin/class-wc-admin-marketplace-promotions.php line 164
    			 * Allows connection error to be handled.
    			 *
    			 * @since 8.7
    			 */
    			do_action( 'woocommerce_page_wc-addons_connection_error', $response_code );
    		}
    
    		$promotions = json_decode( wp_remote_retrieve_body( $raw_promotions ), true );
    
    		if ( ! is_array( $promotions ) ) {
    			$promotions = array();
    
  • /includes/admin/class-wc-admin-marketplace-promotions.php line 177
    			 * Allows connection error to be handled.
    			 *
    			 * @since 8.7
    			 */
    			do_action( 'woocommerce_page_wc-addons_connection_error', 'Malformed response' );
    		}
    		// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
    
    		return $promotions;
    	}
    
    

See this hook used in plugins: