Title: Admin Widgets
Last modified: March 21, 2017

---

# Admin Widgets

 *  Resolved [justdave](https://wordpress.org/support/users/justdave/)
 * (@justdave)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-widgets/)
 * This is a PHP coding question about interacting with the Simple Calendar plugin
   from another plugin.
 * I am attempting to use the simcal_get_calendar() function to load data out of
   a calendar and present it in a widget on the Admin Dashboard in WordPress. In
   this case it’s a bar chart with a bar for each of our chapters showing the percentage
   of organizations within each of those chapters who actually have scheduled events
   on the calendar, to remind chapter leaders to follow up with their members to
   get their meetings on the calendar if they haven’t yet. I have the same chart
   on a normal page and it works fine, but when putting it in the widget, it appears
   that the simcal_get_calendar() call is returning an empty calendar when called
   from an admin page.
 * Looking at the code, it looks like it is purposely not loading the calendar retrieval
   code when loaded from an admin page, which is understandable because it’s probably
   a bit of bloat, so why load it when you don’t need it 🙂 I figured maybe there’s
   some way to trick it into loading when my widget is invoked, but I haven’t figured
   out how yet, so I figured I’d ask.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Nick Young](https://wordpress.org/support/users/nickyoung87/)
 * (@nickyoung87)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-widgets/#post-8992972)
 * I believe you are correct in that it won’t load admin side because those functions
   are loaded only on the public facing side. So you would need to figure out a 
   way to get the calendar by ID/post object/ or whatever method on the admin side.
   Without modifying the plugin directly I wouldn’t be exactly sure how to do that
   without looking deeper into the code for you, and that unfortunately is a bit
   out of the scope of the support offered here.

Viewing 1 replies (of 1 total)

The topic ‘Admin Widgets’ is closed to new replies.

 * ![](https://ps.w.org/google-calendar-events/assets/icon-256x256.png?rev=1263960)
 * [Simple Calendar - Google Calendar Plugin](https://wordpress.org/plugins/google-calendar-events/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-calendar-events/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-calendar-events/)
 * [Active Topics](https://wordpress.org/support/plugin/google-calendar-events/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-calendar-events/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-calendar-events/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Nick Young](https://wordpress.org/support/users/nickyoung87/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/admin-widgets/#post-8992972)
 * Status: resolved