Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How I send the arguments to functions in a plugin?
#1
The same of the topic title,I'm developing a guestbook plugin, i have wrote many functions but i don't understand how send the arguments to functions from the add_action.Variables are declared at the beginning of the file after the comments and i tryed add_action ('content-bottom','my_function',$firstvariable,$secondvariable) but does not work.
My Site: The Harad's Forge
Do you want a guestbook on pages or on news manager articles?Download my GS plugin: ARGuestbook
Reply
#2
Try passing them as an array:
Code:
add_action('content-bottom','my_function',array($firstvariable,$secondvariable));
This should work.

If it still doesn’t, are any errors returns with debug mode on?
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
Thanks,now it works.

I have a question: I have developed a first version of my plugin,it work correctly but there isn't many functions that i'm developing.Can I upload this version?
My Site: The Harad's Forge
Do you want a guestbook on pages or on news manager articles?Download my GS plugin: ARGuestbook
Reply
#4
upload it here and people will gladly test it for you. Once it's stable, i would suggest uploading it to Extend.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 1 Guest(s)