Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Carmine Maraglio
Carmine Maraglio
29,762 Points

WordPress Plugin - Multiple Functions

Hello,

I have developed a WordPress plugin that collects data from a form and saves that info to the wp_options database. I want to expand the plugin to have an additional form/function but am running into issues. If I add in the additional form/function both forms are displayed on the same page of the plugin options page and it breaks the function/ability to save form data. Any advice on how to fix this?

I have the plugin, in working form with the single function, hosted on github- https://github.com/cmaraglio/clubspeed_api

3 Answers

Carmine Maraglio
Carmine Maraglio
29,762 Points

Found my answer. I needed to add_submenu_page and create a separate function with different variable names that stores a new row to the wp_options database. Once I did that, I was able to add a additional function and have everything work as expected. :)

Matthew Proudman
Matthew Proudman
11,879 Points

have you tried to make a if statement which will course one or the other form to show?

Carmine Maraglio
Carmine Maraglio
29,762 Points

I haven'; Ideally the plugin would allow a user to pull in multiple streams of information from the API it's querying and put that on different areas of the site using the widget or shortcode.

Matthew Proudman
Matthew Proudman
11,879 Points

i see then i would need to setup the plugin so that you can from a list of Datapoint (api) which will call the class or function that controls the data (each API will need it's own function or class. it mite be one for the irc channels? (that is stuff they are good at) http://codex.wordpress.org/IRC

hope this helps