Hi I’m using a Trellis/Bedrock (not Sage) setup for my site. And I would like some custom rewrite rules for the admin area. But I can’t seem to get it to work. Does anyone here have any experience rewriting the admin urls?
I would like if a user goes to /wp/wp-admin/sorm-submissions
they would end up at /wp/wp-admin/edit.php?post_type=form&page=form-submissions
(but with the nice url kept, i.e. not a redirect, a rewrite). The destination is created using add_submenu_page()
in the admin_menu
menu hook. And that page works as expected.
This is my current (non functioning) attempt:
add_action('init', function () {
add_rewrite_rule(
'^wp/wp-admin/form-submissions$',
'wp/wp-admin/edit.php?post_type=form&page=form-submissions',
'top',
);
});
Will I have to work with the nginx config to make this work properly on a trellis page?