Create a admin page in wordpress without admin menus (“wordpress sidebars”)

I’m creating a new page in WordPress admin for a theme. In this new page will be a list of people registered (in a form), but with few details / information. So when a person clicks on something, I would like to open a “pop-up” (with all information) but not display this popup/page in the menus of the WordPress administration. Is there any way?

Related posts

Leave a Reply

2 comments

  1. You can use the built in ThickBox to display the popup by Ajax:

    //first add thickbox to your page
    function add_thickbox(){
        if(is_admin() && (isset($_GET['page']) && $_GET['page'] == "my-plugin-file.php") { 
        wp_enqueue_script('jquery');
        wp_enqueue_script('thickbox',null,array('jquery'));
        wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');
        }
    }
    add_action('wp_enqueue_script','add_thickbox');
    
    
    //then in your user list for each user you add the thickbox 
    //popup on the onclick and pass the info needed (like user id) so eg:
    
    ?>
    <!-- for each user add -->
     <a class="thickbox" onclick="javascript: show_user_info(user_id)">user name</a>
    <!-- and then add this function once --> 
    <script>
    function show_user_info(user_id){
        var aj_url = 'admin-ajax.php?action=my_get_user_info&user_id=' + user_id;
        tb_show('userinfo',aj_url );
    }
    </script>
    
    <?php 
    //so all you have left is to create the ajax processing function :
    add_action('wp_ajax_my_get_user_info', 'my_AJAX_processing_function');
    function my_AJAX_processing_function(){
        //echo user info 
        //and remember to die;  
    }