Posts tagged “cpt”

Remove the WordPress post date filter on custom post type admin pages

WordPress custom post types can be very useful for storing all sorts of different types of data in WordPress -- and I should really write a post about that some time. But the date a post was published, i.e. its post_date, isn't important for many custom post types. So why have a drop-down list of dates to filter your custom posts types by if you don't need it?

Remove all meta boxes from WordPress post edit form

When you create a custom post type in WordPress, you can ask register_post_type to generate a default UI for managing your post type in the admin. When you edit your post type, WordPress generates the familiar post editor, just for your post type. You can change it through a variety of hooks, e.g. if you want to add some new meta boxes. But what if you don't want any meta boxes, not even the standard ones?

WordPress admin_init hook and the elusive typenow

In my quest to bring an object oriented separation of concerns to my WordPress plugins, I tend to separate the administration of each custom post type into its own class. I do this by looking at the global variable $typenow after the admin_init action is fired. But $typenow isn't always set after admin_init, so I have to improvise a little.