Running 2 function plugins on the same install. One of them registered custom post type and taxonomy for it no problem. Other one, however, doesn't register taxonomy (post type itself is registered no problem).
Here is the code of post type registration for first plugin (where everything works)
/* Ads Custom Post Type */
/*======================*/
function create_post_type() {
register_post_type( 'Ads',
array(
'labels' => array(
'name' => 'Ads',
'singular_name' => 'Ad',
'menu_name' => 'Ads',
'name_admin_bar' => 'Ad',
'add_new' => 'Add New',
'add_new_item' => 'Add New Ad',
'new_item' => 'New Ad',
'edit_item' => 'Edit Ad',
'view_item' => 'View Ad',
'all_items' => 'All Ads',
'search_items' => 'Search Ads',
'parent_item_colon' => 'Parent Ads:',
'not_found' => 'No ads found.',
'not_found_in_trash' => 'No ads found in Trash.'
),
'public' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => true,
'supports' => array(
'title',
'revisions'
),
)
);
register_taxonomy("Placements", array("ads"), array(
"hierarchical" => true,
"label" => "Placements",
"singular_label" => "Placement",
"rewrite" => true
));
}
add_action( 'init', 'create_post_type' );
And here is one that doesn't register taxonomy
/* Related Custom Post Type */
/*======================*/
function create_related_post_type() {
register_post_type( 'Related',
array(
'labels' => array(
'name' => 'Related',
'singular_name' => 'Related Unit',
'menu_name' => 'Related Units',
'name_admin_bar' => 'Related Unit',
'add_new' => 'Add New',
'add_new_item' => 'Add New Unit',
'new_item' => 'New Unit',
'edit_item' => 'Edit Unit',
'view_item' => 'View Unit',
'all_items' => 'All Units',
'search_items' => 'Search Units',
'parent_item_colon' => 'Parent Units:',
'not_found' => 'No units found.',
'not_found_in_trash' => 'No units found in Trash.'
),
'public' => true,
'has_archive' => true,
'rewrite' => true,
'hierarchical' => true,
'supports' => array(
'title',
'revisions'
),
)
);
register_taxonomy("Collection", array("Related"), array(
"hierarchical" => true,
"label" => "Placements",
"singular_label" => "Placement",
"rewrite" => true
));
}
add_action( 'init', 'create_related_post_type' );
Here is error code that i get. Not sure though, if it's related to this issue. Could be related to settings page.
[Mon Sep 03 20:09:55.199466 2018] [proxy_fcgi:error] [pid 26021] [client 127.0.0.1:33527] AH01071: Got error 'PHP message: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'Related_init' not found or invalid function name in /home/sitedomain/blabla/public_html/wp-includes/class-wp-hook.php on line 286 ', referer: sitedomain/wp-admin/edit.php?post_type=related&page=Related