Skip to main content
added 106 characters in body
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

If you did this instead...

function the_fat_lady_sings() 
{
    wp_die("this plugin is a far harder than i imageined");
}
add_action('publish_post','the_fat_lady_sings')

I think you will see that it does work. The problem you are having with the echo is because WordPress processes the submission and then redirects back to form. You'll never see the echoed string. That submit/process/redirect pattern helps to avoid duplicate form submission. There is a name for the technique, which I can't remember. :)

PS: I am hoping somebody will tell me the name of that technique because it driving me a little crazy.

If you did this instead...

function the_fat_lady_sings() 
{
    wp_die("this plugin is a far harder than i imageined");
}
add_action('publish_post','the_fat_lady_sings')

I think you will see that it does work. The problem you are having with the echo is because WordPress processes the submission and then redirects back to form. You'll never see the echoed string. That submit/process/redirect pattern helps to avoid duplicate form submission. There is a name for the technique, which I can't remember. :)

If you did this instead...

function the_fat_lady_sings() 
{
    wp_die("this plugin is a far harder than i imageined");
}
add_action('publish_post','the_fat_lady_sings')

I think you will see that it does work. The problem you are having with the echo is because WordPress processes the submission and then redirects back to form. You'll never see the echoed string. That submit/process/redirect pattern helps to avoid duplicate form submission. There is a name for the technique, which I can't remember. :)

PS: I am hoping somebody will tell me the name of that technique because it driving me a little crazy.

Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

If you did this instead...

function the_fat_lady_sings() 
{
    wp_die("this plugin is a far harder than i imageined");
}
add_action('publish_post','the_fat_lady_sings')

I think you will see that it does work. The problem you are having with the echo is because WordPress processes the submission and then redirects back to form. You'll never see the echoed string. That submit/process/redirect pattern helps to avoid duplicate form submission. There is a name for the technique, which I can't remember. :)