Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ms_users_redirect() {
- global $pagenow;
- if( defined('DOING_AJAX') && DOING_AJAX ) {
- return;
- }
- $allowed = [
- 'admin-ajax.php' // например
- ];
- // Если запрс не в разрешенных - редирект на морду
- if ( ! in_array( $pagenow, $allowed ) ) {
- if ( ! is_super_admin() ) {
- wp_redirect( site_url() );
- die();
- }
- }
- }
- add_action( 'admin_init','ms_users_redirect' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement