- This topic has 2 replies, 2 voices, and was last updated 5 years, 10 months ago by
cannect.
-
AuthorPosts
-
-
April 13, 2016 at 2:44 am #6277
cannectMemberI do not know if this is normal, but I have it two times already. I create a metabox, then I change something. In this case the post type name, and then my metabox disappears.
I am creating Project Categories:
// Project Category type add_filter('piklist_post_types', 'project_category_post_type'); function project_category_post_type( $post_types ) { $post_types['project_category'] = array( 'labels' => piklist('post_type_labels', 'Project Category') ,'public' => true ,'rewrite' => array( 'slug' => 'project_category' ) // etc. return $post_types; }What I did was to change the ‘project_category’ string in the code above and in the code below. After that change the metabox below did not show when I choose ‘Project Categorie’ -> ‘New’ in the WordPress Admin.
Metabox in parts/meta-boxes:
<?php /* Title: Create Project Category Description: Create a new project category Post Type: project_category Collapse: false */ piklist('field', array( 'type' => 'text', 'field' => 'category', 'label' => 'Category name', 'description' => 'The name of the category to group the project items', 'columns' => 5 ));Someone any clue how to ‘reset’ piklist to recreate the piklist post types and metaboxes?
-
April 13, 2016 at 2:22 pm #6284
JasonKeymasterHi! Unless something odd is caching, that isn’t something that is “reset”. Post types are registered every time WordPress handles a request, they’re not stored in the database. So if you change the post type it should be effective immediately. Make sure you’re changing the $post_types[] index, as that’s the string used for the registration, it’s not the slug.
-
April 14, 2016 at 2:37 am #6291
-
-
AuthorPosts
- You must be logged in to reply to this topic.