WC_Product_CSV_Importer_Controller::output_errors()protectedWC 1.0

Add error message.

Method of the class: WC_Product_CSV_Importer_Controller{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->output_errors();

WC_Product_CSV_Importer_Controller::output_errors() code WC 8.7.0

protected function output_errors() {
	if ( ! $this->errors ) {
		return;
	}

	foreach ( $this->errors as $error ) {
		echo '<div class="error inline">';
		echo '<p>' . esc_html( $error['message'] ) . '</p>';

		if ( ! empty( $error['actions'] ) ) {
			echo '<p>';
			foreach ( $error['actions'] as $action ) {
				echo '<a class="button button-primary" href="' . esc_url( $action['url'] ) . '">' . esc_html( $action['label'] ) . '</a> ';
			}
			echo '</p>';
		}
		echo '</div>';
	}
}