Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

sinemac on "Can widget use data array generated by a plugin?"

$
0
0

[mis-posted this in 'plugins' forum... reposting here... not sure how to delete the other]

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


Viewing all articles
Browse latest Browse all 8245

Trending Articles