WC_Product_CSV_Importer_Controller::get_next_step_link()publicWC 1.0

Get the URL for the next step's screen.

Method of the class: WC_Product_CSV_Importer_Controller{}

No Hooks.

Return

String. URL for next step if a next step exists. Admin URL if it's the last step. Empty string on failure.

Usage

$WC_Product_CSV_Importer_Controller = new WC_Product_CSV_Importer_Controller();
$WC_Product_CSV_Importer_Controller->get_next_step_link( $step );
$step(string)
slug .
Default: current step)

WC_Product_CSV_Importer_Controller::get_next_step_link() code WC 8.7.0

public function get_next_step_link( $step = '' ) {
	if ( ! $step ) {
		$step = $this->step;
	}

	$keys = array_keys( $this->steps );

	if ( end( $keys ) === $step ) {
		return admin_url();
	}

	$step_index = array_search( $step, $keys, true );

	if ( false === $step_index ) {
		return '';
	}

	$params = array(
		'step'               => $keys[ $step_index + 1 ],
		'file'               => str_replace( DIRECTORY_SEPARATOR, '/', $this->file ),
		'delimiter'          => $this->delimiter,
		'update_existing'    => $this->update_existing,
		'map_preferences'    => $this->map_preferences,
		'character_encoding' => $this->character_encoding,
		'_wpnonce'           => wp_create_nonce( 'woocommerce-csv-importer' ), // wp_nonce_url() escapes & to & breaking redirects.
	);

	return add_query_arg( $params );
}