How to access plugin variables from theme templates without using globals?

Using add_filter will automatically pass $errors to your callback function: add_filter(‘form_errors’, ‘return_errors’); function return_errors($errors) { // validate $errors based on form conditions return $errors; } If the filter has more than one variable passed you can access that extra information by adding a filter priority and specifying the number of arguments to pass to the … Read more

Getting List of all registered Dashboard Widgets

The reason for this is that dashboard widgets don’t use the metabox API directly, they use an API that wraps around it, and are only registered on wp_dashboard_setup and wp_network_dashboard_setup. They’re also named dashboard widgets rather than metaboxes, so most users will not know what you’re referring to if you talk about metaboxes. Dashboard metaboxes … Read more