You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the add new redirect page is found at edit.php?post_type=vip-legacy-redirect&page=add-redirect.
This is created by registering a new admin page, via add_submenu_page().
However, since the purpose of the screen is just to add a new instance of a custom post type (something that WP already supports), we can go about this in a different way.
What we need is to allow the creation of new posts (vip-legacy-redirect), and then register a callback that amends the metaboxes on the page, to add a custom metabox that includes the fields we need.
Among other benefits, would be that the Publish metabox would be visible - this allows the later supporting of scheduled publishing of redirects to make them live, and different redirect statuses. Until this we could likely remove these from the Publish metabox.
remove the 'create_posts' => 'do_not_allow' capability. This will turn on the Add New button at the top of the Redirects list page (see "Add Redirect" button in All Redirects page #39), and add a new "Add New" page at post-new.php?post_type=vip-legacy-redirect.
add in methods to register metabox, and provide fields in custom metabox.
remove existing registration of pages and generated HTML methods.
The text was updated successfully, but these errors were encountered:
Currently, the add new redirect page is found at
edit.php?post_type=vip-legacy-redirect&page=add-redirect
.This is created by registering a new admin page, via
add_submenu_page()
.However, since the purpose of the screen is just to add a new instance of a custom post type (something that WP already supports), we can go about this in a different way.
What we need is to allow the creation of new posts (
vip-legacy-redirect
), and then register a callback that amends the metaboxes on the page, to add a custom metabox that includes the fields we need.Among other benefits, would be that the Publish metabox would be visible - this allows the later supporting of scheduled publishing of redirects to make them live, and different redirect statuses. Until this we could likely remove these from the Publish metabox.
'create_posts' => 'do_not_allow'
capability. This will turn on the Add New button at the top of the Redirects list page (see "Add Redirect" button in All Redirects page #39), and add a new "Add New" page atpost-new.php?post_type=vip-legacy-redirect
.The text was updated successfully, but these errors were encountered: