Last active
December 4, 2020 20:37
-
-
Save devwax/b6d8f7e7305a15a33e3d894959339043 to your computer and use it in GitHub Desktop.
Revisions
-
devwax revised this gist
Dec 4, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /* Usage: domain.com/plugins > domain.com/wp-admin/plugins.php (WP Admin > Plugins) -
devwax created this gist
Dec 4, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ /* Usage: domain.com/plugins > domain.com/wp-admin/plugins.php (WP Admin > Plugins) domain.com/pg > domain.com/wp-admin/edit.php?post_type=page (WP Admin > Pages) etc... */ add_action('wp', 'redirect_shortcuts'); function redirect_shortcuts(){ if (is_user_logged_in()) { global $wp; $url = ''; switch ($wp->request) { case 'pl': $url = admin_url('plugins.php'); break; case 'plugins': $url = admin_url('plugins.php'); break; case 'pg': $url = admin_url('edit.php?post_type=page'); break; case 'pages': $url = admin_url('edit.php?post_type=page'); break; case 'media': $url = admin_url('upload.php'); break; case 'jch': $url = admin_url('options-general.php?page=jchoptimize-settings'); break; default: break; } if ($url) { wp_safe_redirect($url); } return; } }