help with first plugin
-
I am trying to write a first simple plugin. All this plugin will do is give a form in the admin area with two checkboxes, yes and no. If you select yes, then the plugin will display extra information outside of the loop. if you say no, then it hides that information.
So what I did was make a div with the ID of wrapper and inside that div is a little info hard coded into the homepage of the site which is currently running on localhost.
I got the plugin showing the form in the admin area, it is activated. I have tried a few methods to getting this to work, this is just the latest.
On the homepage where I want the action to take place I have this code
<code><?php if(function_exists('my_plugin_options')) { showing(); } ?></code>
so what I was wanting was that when the no box was ticked, it would use jquery to hide the wrapper. Simple. But I can’t get the form to communicate with the homepage.
So here is the code for the plugin, it is only 76 lines.
https://wordpress.pastebin.com/6WbzpCsg
below the function call on the index page, I have the wrapper with the code I want to hide.
- The topic ‘help with first plugin’ is closed to new replies.