Created
August 11, 2021 05:54
-
-
Save lianglee/512d1f6bcc81d8806615c10573e46221 to your computer and use it in GitHub Desktop.
Custom administrator page URL
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
<?php | |
function add_custom_any_existing_handler_page_inot(){ | |
if(ossn_isAdminLoggedin()){ | |
ossn_add_hook('page', 'load', 'add_custom_any_existing_handler_page'); | |
ossn_add_hook('page', 'override:view', 'add_custom_any_existing_handler_override'); | |
} | |
} | |
function add_custom_any_existing_handler_override($hook, $type, $return, $params){ | |
if(isset($params['handler']) && !empty($params['handler']) && $params['handler'] == 'administrator' && $params['page'][0] == 'custompage'){ | |
return true; | |
} | |
return false; | |
} | |
function add_custom_any_existing_handler_page($hook, $type, $return, $params){ | |
if(isset($params['handler']) && !empty($params['handler']) && $params['handler'] == 'administrator' && $params['page'][0] == 'custompage'){ | |
$id = $params['page'][0]; | |
echo 'new stuff'; | |
} | |
} | |
ossn_register_callback('ossn', 'init', 'add_custom_any_existing_handler_page_inot'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment