how to error_log(wp_login_url())
I think, while saving the post, you won’t be able to display this result. You can try below instead – Log the output in the database. e.g. update_option(‘some_option’, wp_login_url($redirect)); And then print get_option(‘some_option’) directly somewhere outside this save_post hook callback (e.g. on wp_footer hook). You may need to refresh the page after save post to … Read more