help with plugin development
-
I have a simple plugin that I am trying to make. I made the plugin, made the form for the admin area with a checkbox. If the checkbox is checked, I want to display some content on the homepage. If it is not checked, then I want the content to go away. So on the homepage, I put this in
if(get_option('yes') != 'true')
{
if(function_exists('add_google_subscribe_form'))
add_google_subscribe_form();
}
My problem is that the code ignores the if statement and shows the content. Doesn’t matter if the checkbox is checked or not. Here is my plugin code. It is very short
<?php
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() {
?>
<p>Add Home Home Page SignUp Form?</p><form id="myForm" action="" method="post">
<table width="200" border="0">
<tr>
<td>Yes</td>
<td><input type="checkbox" checked="checked" id="yes" value="true" name="yes"></td>
</tr>
<tr>
<td>No</td>
<td><input type="checkbox" id="no" id="no" value="false" name="no"></td>
</tr>
</table>
<input type="submit" value="submit" name="submit">
save
</form><?php
}
?><?php
function add_google_subscribe_form() {
$content = "<div id=\"wrapper\">
<div id=\"background\">
<div id=\"emailForm\">
<p>Enter Your Email</p>
<form action=\"https://feedburner.google.com/fb/a/mailverify\" method=\"post\" target=\"popupwindow\" onsubmit=\"window.open('https://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=\"\" />
</form>
</div><!--END emailForm-->
</div><!--END background-->
</div>";echo($content);
}
?>
- The topic ‘help with plugin development’ is closed to new replies.