Greetings!
I have created my first plugin with WordPress 2.9.2: it simply triggers an email notification to a distribution list whenever a blog post is made.
It works well but the CSS for the page showing the changes in option do not show up...only the notification message.
Here's my plugin code
<?php
include('include/email-admin.php');
$email_list=get_option('email_list');
function email_team($post_ID) {
global $email_list;
$team = $email_list;
$body = 'There is a new post on the blog: http://my_host_name/wordpress';
mail($team, "Blog Update",
'There is a new post on the blog: http://my_host_name/wordpress');
return $post_ID;
}
add_action ( 'publish_post', 'email_team' );
?>
...And my "include/email-admin" code
<?php
if (isset ($_POST['email_list'])) {
$email_list = $_POST['email_list'];
update_option('email_list', $email_list); ?>
<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
<?php} else { $email_list = get_option('email_list');}?>
<?php
function email_team_create_menu() {
add_menu_page('Email Team - Plugin Settings',
'Email Team - Settings', 'administrator',
__FILE__, 'email_team_settings_page',
'');
add_action( 'admin_init', 'register_mysettings' );
}
function register_mysettings() {
register_setting( 'email_team-settings-group', 'email_list' );
}
function email_team_settings_page() { ?>
<div class="wrap">
<h2>Email Team - Settings</h2>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<?php settings_fields( 'email_team-settings-group' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">Email list (separated by commas)</th>
<td><input type="text" name="email_list" value="<?php echo get_option('email_list'); ?>" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php }
?>
The message Options saved does show up whenever I update the email distribution list but on a white background. All the CSS is missing....am I missing something?
Any help welcome. Thanks.
Al.