function corp_210517_save_post($post_id, $post, $update) {
    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
        return $post_id;
    if( wp_is_post_revision( $post_id ) ) {
    $etype = get_post_meta( $post_id, 'ver_type_select', true );
    $regurl = add_query_arg(
            'pone' => $post_id,
            'ptwo' => $etype
add_action( 'save_post_corporation', 'corp_210517_save_post', 10, 3);  

Let me explain what is happening here. For new post, after publish reg_url still remain blank because on publish get_post_meta( $post_id, 'ver_type_select', true ); is not returning the new meta value instead it takes the previous value, which is null.

Similarly, on updating the post, get_post_meta( $post_id, 'ver_type_select', true ) is returning the older value not the current updated value.

I don’t what I am doing wrong! seems like hook or priority issue causing this problem. Please help

This is the framework, using to create metabox.

Read more here: Get updated meta value after post update or published (custom post type) using hook


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: