Title: Can widget use data array generated by a plugin?
Last modified: August 21, 2016

---

# Can widget use data array generated by a plugin?

 *  [Scott McCulloch](https://wordpress.org/support/users/sinemac/)
 * (@sinemac)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/can-widget-use-data-array-generated-by-a-plugin/)
 * I’m creating my first plugin and some widgets for a colleague’s site, and I thought
   I’d separate the data retrieval part from the data display part, but I seem to
   be missing something (if it’s even possible).
 * I’ve created a plugin that will query the database and return an array ($report_data)
   when certain conditions are met in the page url. I’ve got that working – print_r(
   $report_data) confirms that the correct data is returned on the correct pages.(
   I’ve got the ‘add_action’ for the plugin set to “loop_start” ).
 * Now I’d like to have my widgets use that data to generate content for display–
   tables, graphics, etc… but when I load the widget into the post, I get an error
   that its missing the argument required (i.e., the $report_data array isn’t being
   picked up by the widget).
 * Is what I’m trying to do even possible?
    If so, what might I be missing?
 * Thanks,
    Scott

The topic ‘Can widget use data array generated by a plugin?’ is closed to new replies.

## Tags

 * [plugin widget](https://wordpress.org/support/topic-tag/plugin-widget/)

 * 0 replies
 * 1 participant
 * Last reply from: [Scott McCulloch](https://wordpress.org/support/users/sinemac/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/can-widget-use-data-array-generated-by-a-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
