get_option('admin_email'), 'text_string2' => 'New blog entry!', 'text_string3' => 'A blog author has submitted a new entry. You need to authorise this entry before it will go live on the site.', 'text_string4' => 'Thank you for your entry. An Administrator will now need to approve it before it can appear live on the site.' ); update_option('aan_kl_options', $options); } /* ########################### 2: Settings page - interface ############################### */ function aan_kl_create_settings_page () { add_options_page( 'Admin and Author Notification Settings', 'Admin and Author Notification Settings', 'manage_options', __FILE__, 'aan_kl_setup_settings_page' ); } function aan_kl_setup_settings_page () { ?>

Admin and Author Notification Settings


Enter the email and javascript alert() details below.

'; } function aan_kl_setting_input() { $options = get_option( 'aan_kl_options' ); $text_string = $options['text_string']; echo ""; } function aan_kl_setting_input_subjline() { $options = get_option( 'aan_kl_options' ); $text_string2 = $options['text_string2']; echo ""; } function aan_kl_setting_input_bodytext() { $options = get_option( 'aan_kl_options' ); $text_string3 = $options['text_string3']; echo ""; } function aan_kl_setting_js_alert_bodytext() { $options = get_option( 'aan_kl_options' ); $text_string4 = $options['text_string4']; echo ""; } /* ########################### 4: Do the work ############################### */ function aan_kl_get_the_alert() { $aan_kl_optional = get_option('aan_kl_options'); $aan_kl_alert_message = $aan_kl_optional['text_string4']; $aan_kl_admin_email = $aan_kl_optional['text_string']; $aan_kl_email_subject = $aan_kl_optional['text_string2']; $aan_kl_email_body = $aan_kl_optional['text_string3']; wp_mail( $aan_kl_admin_email, '$aan_kl_email_subject', '$aan_kl_email_body' ); $aan_kl_redirect_location = admin_url(); echo " "; exit; } add_action('admin_menu', 'aan_kl_create_settings_page'); add_action('draft_to_publish', 'aan_kl_get_the_alert'); ?>