Delete map_meta_cap. it will appear in your dashboard
'map_meta_cap' => true, //remove this line
why are you trying to restrict all those capabilities? IT look likes you’ve not given yourself capability to see the post with the restrictions there…
if you don’t know why those are there, you may not need any of these lines: (SAVE A COPY OF THE PLUGIN BEFORE JUST IN CASE THOUGH AS THERE MAY BE ANOTHER FUNCTION THAT REQUIRES THIS FOR SOME REASON. ie you have a function at the end of the code that is looking at capabilities as well.)
'map_meta_cap' => true,
'capabilities' => array(
'edit_post' => 'edit_portfolio',
'edit_posts' => 'edit_portfolio',
'edit_others_posts' => 'edit_other_portfolio',
'publish_posts' => 'publish_portfolio',
'edit_publish_posts' => 'edit_publish_portfolio',
'read_post' => 'read_portfolio',
'read_private_posts' => 'read_private_portfolio',
'delete_post' => 'delete_portfolio',
'delete_posts' => 'delete_portfolio',
'delete_others_posts' => 'delete_others_portfolio',
'delete_published_posts' => 'delete_published_portfolio'
),
'capability_type' => array('portfolio', 'portfolio'),
additionally i’m a big proponent of namespace to reduce future conflicts. There will be lots of people and themes that use “portfolio” as their cpt.
your portfolio name is already identified (bk_portfolio instead of just portfolio) but your actual function isn’t.
function register_portfolio() {
should be
function bk_register_portfolio() {
and you’ll need to make sure to call the right function by changing
add_action( 'init', 'register_portfolio' );
to
add_action( 'init', 'bk_register_portfolio' );
LASTLY.
in your lables array you’ve named your portfolio “add new portfolio” that doesn’t make sense. “name” label should be plural as well. Change it to Portfolios. and then you can change your add new lined to “Add new Portfolio”…(okay that one is just nit picky)
$labels = array(
'name' => __( 'Add New Portfolio', 'bk' ), //change to Portfolios
'singular_name' => __( 'Portfolio', 'bk' ),
'add_new' => __( 'Add New', 'bk' ), //Change to Add New Portfolio
'add_new_item' => __( 'Add New Portfolio Item', 'bk' ),
'edit_item' => __( 'Edit Portfolio', 'bk' ),
'new_item' => __( 'New Portfolio', 'bk' ),
'view_item' => __( 'View Portfolio', 'bk' ),
'search_items' => __( 'Search Portfolio', 'bk' ),
'not_found' => __( 'No Portfolio found', 'bk' ),
'not_found_in_trash' => __( 'No Portfolio found in Trash', 'bk' ),
'parent_item_colon' => __( 'Parent Portfolio:', 'bk' ),
'menu_name' => __( 'Portfolio', 'bk' ),
);