function update_post( $post_id ) { $post = array( 'ID' => $post_id, 'post_title' => '#'.$post_id, 'post_name' => $post_id, ); wp_update_post( $post ); update_post_meta($post_id, 'order', $post_id); } add_action('save_post_booking', 'update_post', 20);