Support » Developing with WordPress » Admin_post_nonpriv not being triggered

  • Resolved Jim Hennessy

    (@xcncadmin)


    I have just built my first plugin. It works as I expect it to when I am logged in as the Admin.

    I have a form where it does a post method to refresh the screen and show selected records.

    Below is snippet of the code

    <form method='post' action='http://xc.com/wp-admin/admin-post.php'>
         	<input name='action' type='hidden' value = 've_post_refresh_with_id'>
           	 <input name='refresh_button' value='Add/Update users on Shifts'  type='submit'/>
               </form>

    I have created two actions 1) admin_post and 2) admin_post_nonpriv

    add_action( 'admin_post_ve_post_refresh_with_id’, ‘ve_post_refresh_with_id’ );
    add_action( 'admin_post_nonpriv_ve_post_refresh_with_id’, ‘ve_post_refresh_with_id’);

    I have truncated the function ve_post_refresh_with_id so that it just echos “Hello”
    Function ve_post_refresh_with_id($atts){ echo "Started <br>"; }

    When I am in admin mode it works, when I am not logged in it does not.

    If manually add the parameter on the end of the URL “?event_id=6” I get the results I am expecting.

    How do I chase down the problem?

    What am I doing wrong?

    • This topic was modified 3 weeks, 6 days ago by Jim Hennessy.
    • This topic was modified 3 weeks, 6 days ago by Jim Hennessy.
    • This topic was modified 3 weeks, 6 days ago by Jim Hennessy.
    • This topic was modified 3 weeks, 6 days ago by Jim Hennessy.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.