Hi,
With the skeleton plugin what I did was create the DB access stuff (the basic create, some inserts etc) in the classes file.
then most of my functions are in the templatetags file (some also access/insert/update the db).
the form is in the main plugin php file (resides under wp-content/plugins) and it calls all the necessary files.
when you post the data in the form and then call a specific function to do the processing you can access the form variables using $_POST (that is in case you use post in your form).
If you need more help or having specific questions let me know. I am not a big expert but I got several plugins created using the skeleton and if its working…dont touch it
Shai
Ok thanks a lot man! I defiantly understand the structure a lot better, but I have a few more questions after that… What file exactly is the form suppose to be under?
…the way I was trying to set it up was put it in the templates folder then create a file with the default theme code plus the form code in the same file. Once the user hits the submit button can I just collect that $_POST data anywhere in my plugin?
ok i’ll try to explain what i did.
when you install the plugin in its original form is it called bp-example so i will stick to that naming convention.
under wp-content/plugins you have the folder called bp-example with all the files in it (class, templatetags etc).
under wp-content/plugins you also have a file called bp-example.php
(if you put these two in place you can activate the bp-example plugin without making any changes).
anyways, I created my form inside bp-example.php
my form started with something like that:
<form id=”form1″ name=”form1″ action=”<?php bp_example_do_something() ?>” method=”post”>
rest of form is here etc
later i have the submit button to submit the form etc.
once you submit the form it calls the function in the action. this function is in bp-example-temlatetags.php that is in the bp-example folder.
inside this function you can use the $_POST and do whatever you want with your POST variables.
hope this helps.
Thanks,
Shai
I think you might have helped me out there too.
It isn’t at all clear how to deal with form data, it would make a great tutorial.
Thanks.
Well everyone has been very helpful, but I am still very confused on how this system works and since I have had no time to experiment I’ve decided to just keep this thread alive. So my last question is: Can I just handle form data anywhere within the plugin or is it in a certain class that this has to be done? … I think I am also going to try to directly ask the plugin developers maybe they would be able to better explain it…
Please let me know what you are trying to achieve and I will try to help if I can understand