Created
April 29, 2020 06:40
-
-
Save devwax/388107906cf8e144058391f3d77d6350 to your computer and use it in GitHub Desktop.
WP - Admin Recent History
This file contains 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 characters
add_action( 'admin_init', 'admin_recent' ); | |
// add_action( 'current_screen', 'admin_recent' ); | |
function admin_recent() { | |
// $currentScreen = get_current_screen(); | |
// if( $currentScreen->id === "widgets" ) { | |
// Run some code, only on the admin widgets page | |
// } | |
// error_log(print_r($currentScreen, true)); | |
// error_log(get_admin_url()); | |
// $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
// https://stackoverflow.com/a/6768831/2480125 | |
// if ( isset($_SERVER['REQUEST_URI']) && get_admin_page_title() ) { | |
// if ( true ) { | |
// $currentScreen = get_current_screen(); | |
// // error_log(print_r($currentScreen, true)); | |
// error_log('Page Title: ' . get_admin_page_title()); | |
// error_log('Screen ID: ' . $currentScreen->id); | |
// error_log('Permalink: ' . rtrim(get_admin_url(), '/') . $_SERVER['REQUEST_URI']); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment