Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
509 views
in Plugins by
reopened by

I've been working on my first plugin. I can't seem to output content unless I output it as part of a form like this: 

$qa_content=qa_content_prepare();

$qa_content['form']=array(

//DO STUFF...

)

If I change $qa_content['form'] to $qa_content['div'], nothing appears on the plugin page except for the rest of page styling. I can't seem to find and documentation on qa_content_prepare() or what it does. I can't even figure out where the function is defined. What does it do? How do I use it to output content other than forms?

Q2A version: 1.6.3
by
Good question btw. For all others: You find the function in qa-page.php.
by
I would love someone just to write out some basic guidelines on how this thing works and how to use it. I've figured it out some, but Im still a little confused.

1 Answer

+1 vote
by

Like its mentioned in the comment on the function (found in qa-include/qa-page.php) it generates all the markups and content for each page that is displayed in Q2A - "Start preparing theme content in global $qa_content variable, with or without $voting support, in the context of the categories in $categoryids (if not null)"

by
Yeah, I read that stuff. I guess I was just interested in learning more about how things like $qa_content['form'] work. Not clear on what array values are acceptable here. They seem to be predefined but Im not sure/why/how/where...
...