WordPress widget to display an AWeber opt-in form.
Author: Charles Stricklin
Version: 1.0d
Author URI: http://charlesstricklin.com
Mucho, mucho thanks to Chris Meller for his help.
Released under the GNU General Public License (GPL)
http://www.gnu.org/licenses/gpl.txt
*/
function custom_aweber_widget($args) {
extract($args);
$options = get_option('aweber_widget');
echo $before_widget . $before_title . $options['title'] . $after_title . $options['text'] . $after_widget . "\n";
}
function custom_aweber_widget_control() {
$options = $newoptions = get_option('aweber_widget');
if ( $_POST["aweber_widget-submit"] ) {
$newoptions['title'] = strip_tags(stripslashes($_POST["aweber_widget-title"]));
$newoptions['text'] = stripslashes($_POST['aweber_widget-text']);
$newoptions['form'] = stripslashes($_POST['aweber_widget-form']);
$newoptions['disclaimer'] = stripslashes($_POST['aweber_widget-disclaimer']);
}
if ( $options != $newoptions ) {
$options = $newoptions;
update_option('aweber_widget', $options);
}
$title = attribute_escape($options['title']);
$text = attribute_escape($options['text']);
$form = attribute_escape($options['form']);
$disclaimer = attribute_escape($options['disclaimer']);
?>
300, 'width'=>400));
}
add_action('init', 'register_aweber_widget');
?>