WC_Product_CSV_Importer_Controller::dispatch
Dispatch current step and show correct view.
Метод класса: WC_Product_CSV_Importer_Controller{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Product_CSV_Importer_Controller = new WC_Product_CSV_Importer_Controller(); $WC_Product_CSV_Importer_Controller->dispatch();
Код WC_Product_CSV_Importer_Controller::dispatch() WC Product CSV Importer Controller::dispatch WC 10.3.5
public function dispatch() {
$output = '';
try {
// phpcs:ignore WordPress.Security.NonceVerification.Missing
if ( ! empty( $_POST['save_step'] ) && ! empty( $this->steps[ $this->step ]['handler'] ) ) {
if ( is_callable( $this->steps[ $this->step ]['handler'] ) ) {
call_user_func( $this->steps[ $this->step ]['handler'], $this );
}
}
ob_start();
if ( is_callable( $this->steps[ $this->step ]['view'] ) ) {
call_user_func( $this->steps[ $this->step ]['view'], $this );
}
$output = ob_get_clean();
} catch ( \Exception $e ) {
$this->add_error( $e->getMessage() );
}
$this->output_header();
$this->output_steps();
$this->output_errors();
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- output is HTML we've generated ourselves.
$this->output_footer();
}