wp-admin remove part of the url

I’ve searched in the admin templates. It seems the placeholders rely on the functions wp_get_referer() and wp_get_raw_referer() which use $_SERVER[“REQUEST_URI”], $_SERVER[‘HTTP_REFERER’] and a wp custom variable passed in the request : $_REQUEST[‘_wp_http_referer’]. So WordPress builds some URLs (apparently not all) on REQUEST_URI, that is /wp-admin/whatever (in the backend). The logs show that wp-admin/admin-ajax.php comes through … Read more

Enque script based on url paramater

There are a couple of ways to do this. The easiest way is to use $_GET: if ( ( $hook == ‘post-new.php’ || $hook == ‘post.php’ ) && $_GET[‘action’] == ‘edit’ ) { // Enqueue your scripts here } You can also use the get_current_screen(); function instead of using a global variable.