Most plugins try to hide the components of the edit.php screen on wp admin and replace it with meta boxes to create the needed layout and fields for the custom post type.
But this means that there is still unnecessary code on that edit.php page not used and increases the page load. Also, Not everything can be done using meta boxes.
Is there is a way where i can create my own edit.php page from scratch for my custom post type? maybe hide the custom post type UI and make a new admin page and use it to insert the custom posts or update it? is this possible on admin pages?
Most plugins try to hide the components of the edit.php screen on wp admin and replace it with meta boxes to create the needed layout and fields for the custom post type.
But this means that there is still unnecessary code on that edit.php page not used and increases the page load. Also, Not everything can be done using meta boxes.
Is there is a way where i can create my own edit.php page from scratch for my custom post type? maybe hide the custom post type UI and make a new admin page and use it to insert the custom posts or update it? is this possible on admin pages?
Share Improve this question asked Aug 3, 2013 at 22:29 alhoseanyalhoseany 1,2013 gold badges15 silver badges23 bronze badges 1- You can use a plugin like Advanced Custom Fields wordpress.org/plugins/advanced-custom-fields – Cleber Reizen Commented Mar 9, 2022 at 14:53
1 Answer
Reset to default 4When you register the CPT set show_ui
to false. For example:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => false, // <-- here
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'book' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
);
You will now have to construct an interface for the CPT just as you'd construct one for a admin plugin page. You are not reconstructing or editing edit.php
. Your interface will have a different address as given when you register the admin page.