WordPress.org

Ready to get started?Download WordPress

Forums

'simple_edit_form' action hook not working? (3 posts)

  1. uncmacguy
    Member
    Posted 8 years ago #

    I am developing a plugin for wordpress that requires additional form fields to be added to the Simple Edit Post Form. The following is some example code.

    function myFunction(){
    echo("Hello World");
    }

    add_action('simple_edit_form','myFunction');

    Now, when I click 'Write' in the wordpress administration section, I do see "Hello World" printed below the default Simple Edit Post Form. However, when I click 'Manage', then click 'Edit' for a given post, my plugin does not output "Hello World" below the Simple Edit Form. Why? My plugin only seems to be called when creating a new post, not when editing an existing post. Is this a feature or a bug? Or is there something in the above code that is not correct? Any and all help is greatly appreciated!

  2. Kafkaesqui

    Posted 8 years ago #

    "However, when I click 'Manage', then click 'Edit' for a given post, my plugin does not output "Hello World" below the Simple Edit Form. Why?"

    Because you're on longer on the "simple edit" page. Insert an additional action to have it appear on the advanced form page as well:

    add_action('edit_form_advanced', 'myFunction');

  3. uncmacguy
    Member
    Posted 8 years ago #

    Thank you! That did it. I appreciate the help.

Topic Closed

This topic has been closed to new replies.

About this Topic