WP-Router icon indicating copy to clipboard operation
WP-Router copied to clipboard

How to get query params and parameters in url?

Open falahatiali opened this issue 4 years ago • 1 comments

examine we have this : 'path' => 'download/file/([0-9]+)/{name}',

how we can get these parameters in function ?


function create_routes_customs( $router ) {	
	$router->add_route('download', array(
		'path' => 'download/file/([0-9]+)/{name}',
		'access_callback' => true,      
		'page_callback' => 'download'
	));
}

function download(){
//get params
}

falahatiali avatar Jun 25 '20 20:06 falahatiali