Hey everyone. I’m developing a plugin and I’d like to be able to call a sidebar inside of the wordpress admin. Unfortunately, the function get_sidebar($name); uses some other core wordpress functions that are not included in the wp-admin. Here is a list of them and what function they have:
/wp-includes/general-template.php contains the get_sidebar function
/wp-includes/plugins.php contains the do_action function.
/wp-includes/template.php contains the load_template and locate_template functions.
I’ve tried including all of these functions in the admin to attempt to get the get_sidebar call to work. This produced no results as I believe the function uses template files from your theme to complete the passing of widgets to a sidebar. Any ideas on how to call sidebars in the wp-admin? I can’t find info anywhere. Thanks.
I don’t think the problem is access to functions, the problem is the admin panels are not widget friendly. Using get_sidebar() may never work because you are trying to load a template into a page that is not template based. You do not need a template to display widgets anyway. You just need to call dynamic_sidebar() with a registered sidebar ID.
If you are widgetizing your own custom admin panel, that should do it. If you are modifying existing admin panels, try one of the methods for adding any other content. Perhaps the Settings API sections or adding a meta box, depending on the target page.