Jump to content

help with my wordpress plugin


Recommended Posts

I am trying to put together a plugin that will display a form in the admin area that will have two checkboxes.


One that says yes,

one that says no.


I have done this. it is working


The purpose of the plugin is to put in xhtml content into the homepage outside of the loop. I CAN do this without the admin options. Now I am just trying to add this extra bit of functionality to learn how to do it. So on the homepage where I want the xhtml code to show I put in this


if(function_exists('adding_content_admin_menu')) { do_it($yes); }


In the function do_it() I have passed in the variable $yes. I did this just to try it. I don't know if I am doing it right. The idea is that if they check the yes box, it will call the function do_it which will check to see that yes was selected and then it will call the function

add_google_subscribe_form() which will put the content onto the homepage. Here is all my code. I am sure there is an easier way, I am a beginner and this is one of many different variations. Please explain and instructions as I do not know php very well.


add_action('admin_menu', 'adding_content_admin_menu');

function adding_content_admin_menu() {
add_options_page('Add Content Option', 'Feedburner Signup Form','manage_options','AddFeedburner','adding_content_to_homepage');		

function adding_content_to_homepage($yes) {
<p>Add Home Home Page SignUp Form?</p>

<form id="myForm" action="" method="post">
	<table width="200" border="0">
			<td><input type="checkbox" id="yes" name="<?php $yes ?>"></td>
			<td><input type="checkbox" id="no" name="<?php $no ?>"></td>
	<input type="submit" value="submit">


function do_it($yes){
if(isset($_POST['submit'])) {
	if(isset($_POST['yes'])) {
		return false;

function add_google_subscribe_form() {
$content = "<div id=\"wrapper\">
				<div id=\"background\">
					<div id=\"emailForm\">
						<p>Enter Your Email</p>
					<form action=\"http://feedburner.google.com/fb/a/mailverify\" method=\"post\" target=\"popupwindow\" onsubmit=\"window.open('http://feedburner.google.com/fb/a/mailverify?uri=MtScottChurchOfGod', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true\">
						<input id=\"emailInput\" type=\"text\" name=\"email\" />
						<input type=\"hidden\" value=\"MtScottChurchOfGod\" name=\"uri\"/>
						<input type=\"hidden\" name=\"loc\" value=\"en_US\"/>
						<input id=\"button\" type=\"submit\" value=\"\" />
				</div><!--END emailForm-->
			</div><!--END background-->


Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.