kevleitch
Member
Posted 8 months ago #
<?php
function trigger_alert() {
echo '<script language="Javascript">alert("Your entry has been submitted. You may have to wait for an Editor to approve it.")</script>';
}
function some_post_actions( $post_ID ) {
$friends = 'email@gmail.com';
wp_mail( $friends, "Site updated", 'The blog site has been updated. Please check for a new entry.' );
}?><?php add_action('admin_enqueue_scripts', 'trigger_alert');
return $post_ID;?>
So thats what I have. The emailing of the designated user works fine but I simply cannot get the Javascript alert to be called successfully.
Any pointers would be gratefully received :)
Kev.
kevleitch
Member
Posted 8 months ago #
Please note, I screwed that code up. It should be:
<?php
function trigger_alert() {
echo '<script language="Javascript">alert("Your entry has been submitted. You may have to wait for an Editor to approve it.")</script>';
}
function some_post_actions( $post_ID ) {
$friends = 'email@gmail.com';
wp_mail( $friends, "Site updated", 'The blog site has been updated. Please check for a new entry.' );
add_action('admin_enqueue_scripts', 'trigger_alert');
return $post_ID;?>
}?>
kevleitch
Member
Posted 8 months ago #
Just to add insult to injury, I screwed that up too. I should have this as the last line:
<?php add_action('draft_to_publish', 'some_post_actions');?>
Thanks for sticking with me ;)