WC_Admin_Dashboard_Setup::get_button_link()publicWC 1.0

Get the button link for a given task.

{} It's a method of the class: WC_Admin_Dashboard_Setup{}

No Hooks.

Return

String.

Usage

$WC_Admin_Dashboard_Setup = new WC_Admin_Dashboard_Setup();
$WC_Admin_Dashboard_Setup->get_button_link( $task );
$task(Task) (required)
Task.

Code of WC_Admin_Dashboard_Setup::get_button_link() WC 6.7.0

public function get_button_link( $task ) {
	$url = $task->get_json()['actionUrl'];

	if ( substr( $url, 0, 4 ) === 'http' ) {
		return $url;
	} elseif ( $url ) {
		return wc_admin_url( '&path=' . $url );
	}

	return admin_url( 'admin.php?page=wc-admin&task=' . $task->get_id() );
}