Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions mu-plugins/_core-redirect-on-post-update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/*
* Plugin Name: Redirect to Posts page on post update
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
*/

add_filter(
'redirect_post_location',
static function ($location, $post_id) {
return add_query_arg(
['post_type' => get_post_type($post_id)],
admin_url('edit.php') // Posts page
);
/*
return add_query_arg(
['post_type' => get_post_type($post_id)],
admin_url('post-new.php') // Add New Post page
);
*/
/*
return get_preview_post_link($post_id);
*/
},
10,
2
);