Skip to content

Instantly share code, notes, and snippets.

@sbruner
Last active November 17, 2016 02:59
Show Gist options
  • Save sbruner/ea33171ae4af0db7d914 to your computer and use it in GitHub Desktop.
Save sbruner/ea33171ae4af0db7d914 to your computer and use it in GitHub Desktop.
Piklist: Registering Post Types
<?php
add_filter('piklist_post_types', 'piklist_demo_post_types');
function piklist_demo_post_types($post_types)
{
$post_types['piklist_demo'] = array(
'labels' => piklist('post_type_labels', 'Piklist Demo')
,'title' => __('Enter a new Demo Title')
,'menu_icon' => piklist('url', 'piklist') . '/parts/img/piklist-menu-icon.svg'
,'page_icon' => piklist('url', 'piklist') . '/parts/img/piklist-page-icon-32.png'
,'supports' => array(
'title'
,'post-formats'
)
,'public' => true
,'admin_body_class' => array(
'custom-body-class'
)
,'has_archive' => true
,'rewrite' => array(
'slug' => 'piklist-demo'
)
,'capability_type' => 'post'
,'edit_columns' => array(
'title' => __('Demo')
,'author' => __('Assigned to')
)
,'hide_meta_box' => array(
'author'
)
,'status' => array(
'new' => array(
'label' => 'New'
,'public' => false
)
,'pending' => array(
'label' => 'Pending Review'
,'public' => false
)
,'demo' => array(
'label' => 'Demo'
,'public' => true
,'exclude_from_search' => true
,'show_in_admin_all_list' => true
,'show_in_admin_status_list' => true
)
,'lock' => array(
'label' => 'Lock'
,'public' => true
)
)
);
return $post_types;
}
?>
@pax
Copy link

pax commented Oct 26, 2016

there's an extra comma on line 30 ,'author'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment