Forums

[resolved] Save $_POST data in form placed using add_action('edit_category_form' (3 posts)

  1. shahar
    Member
    Posted 2 years ago #

    I have placed a form on the edit categories admin page using add_action('edit_category_form'.

    When I view the page in the browser I see that:

    1) My form tags are stripped
    2) The form is included in the id="editcat" form
    3) That form's action is categories.php

    When I submit the form on the 'Edit Category' page I return to 'Categories' and my $_POST has disappeared.

    How do I get to the $_POST data that's sent and use in a function?

    Thanks for _any_ guidance!

  2. shahar
    Member
    Posted 2 years ago #

    any suggestions?

  3. shahar
    Member
    Posted 2 years ago #

    So I solved it by calling the function in the main body of the plugin file inside an if that checks for my $_POST variables:

    // Save before $_POST is re-set by categories.php
    if(isset($_POST['my_post'])){
    	my_function();
    }

    Maybe there's a better way, but this works :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags