Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Plugins by
I want to add a button to questions , and let the button pass my post_id(later same code will be sued for answers).

I do all this in my layer class.

I add a button, with :   'tags' => 'NAME="action_name" ID="1" ' .  The button shows correctly.

I then add :

function doctype(){

    if (qa_clicked('action_name'){

   qa_redirect(qa_post_text('ID'));   //tried this is also with qa_get('ID')



But this doesn't work.

I tried writing the qa_clicked in qa-plugin but there's no access to qa functions , and i looked in other plugins and it's okay to use qa_clicked inside layers.

How do i read the ID parameter from the qa_clicked function ?

1 Answer

+1 vote

This is an HTML issue. You need the button tag itself to be something like:

NAME="action_name" VALUE="1" 

And then you use qa_post_text('action_name') to read it.