Home Forums Plugin Support WP User Frontend Pro $_GET[ ] with wpuf_add_post_after_insert

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Tareq Hasan 5 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13144

    bazelski
    Participant
    Post count: 28

    url
    home_url/add_new_post_form/?event_id=942

    function is not not working / meta field is created but there is no value

    function meta_event( $post_id ) {
    			
    			if ( isset( $_GET['event_id'] ) ) {
    		        update_post_meta($post_id, 'event', $_GET['event_id'] );
    			}
    }
    add_action( 'wpuf_add_post_after_insert', 'meta_event' );
    
    #13177

    Tareq Hasan
    Keymaster
    Post count: 2831

    You can't access the $_GET variable in that action hook. It's running via ajax and no $_GET variables are passing there. You could insert the event id as hidden field in the form and then you can access it with that action hook.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘$_GET[ ] with wpuf_add_post_after_insert’ is closed to new replies.