atthewood
Forum Replies Created
-
Out of curiosity, what in particular did you change? I’m having the same issue.
Forum: Plugins
In reply to: [Custom Post Type UI] Issue with Capability TypeHonestly, I just hard coded it into the functions.php. I can share the code that worked for me.
But a friend had the same issue (though she may have been using a different, but similar plugin). I believe she said she assigned the custom capability type and the custom post type disappeared from the menu. But when she assigned a user that capability type, it reappeared.
I’d be curious if that actually works.
But if that doesn’t work, here’s the code:
/*Organization Listing Post type */
function register_custom_event_type() {
$labels = array(
‘name’ => (‘Organization Listings’),
‘singular_name’ => (‘Organization Listing’),
‘add_new’ => (‘Add New’),
‘add_new_item’ => (‘Add New Listing’),
‘edit_item’ => (‘Edit Listing’),
‘new_item’ => (‘New Listing’),
‘view_item’ => (‘View Listing’),
‘search_items’ => (‘Search Listing’),
‘not_found’ => (‘No listings found’),
‘not_found_in_trash’ => (‘No listings found in Trash’),
‘parent_item_colon’ => (‘Parent Listing:’),
‘menu_name’ => (‘Organization Listings’),);
$args = array(
‘description’ => ‘organization listings’,
‘labels’ => $labels,
‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘revisions’ , ‘author’, ‘comments’),
‘hierarchical’ => false,
‘public’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘menu_position’ => 3,
‘menu_icon’ => ‘dashicons-store’,
‘show_in_admin_bar’ => true,
‘show_in_nav_menus’ => true,
‘can_export’ => true,
‘has_archive’ => true,
‘exclude_from_search’ => false,
‘publicly_queryable’ => true,
‘capability_type’ => ‘organization-listing’,
‘capabilities’ => array(
‘read_post’ => ‘org_read_post’,
‘publish_posts’ => ‘org_publish_posts’,
‘edit_others_posts’ => ‘org_edit_others_posts’,
‘delete_posts’ => ‘org_delete_posts’,
‘delete_others_posts’ => ‘org_delete_others_posts’,
‘read_private_posts’ => ‘org_read_private_posts’,
‘edit_post’ => ‘org_edit_post’,
‘edit_posts’ => ‘org_edit_posts’,
‘delete_post’ => ‘org_delete_post’,
‘delete_published_posts’ => ‘org_delete_published_posts’,
‘edit_published_posts’ => ‘org_edit_published_posts’,
‘edit_private_posts’ => ‘org_edit_private_posts’,
‘read_private_posts’ => ‘org_read_private_posts’,
),
‘map_meta_cap’ => true
);
register_post_type(‘organization-listing’, $args);}
add_action(‘init’, ‘register_custom_event_type’, 0);
//Add Organization Custom Capabilities to Admin Role
function add_event_caps() {
$role = get_role( ‘administrator’ );$role->add_cap( ‘org_edit_post’ );
$role->add_cap( ‘org_edit_posts’ );
$role->add_cap( ‘org_edit_others_posts’ );
$role->add_cap( ‘org_publish_posts’ );
$role->add_cap( ‘org_read_post’ );
$role->add_cap( ‘read_private_events’ );
$role->add_cap( ‘org_delete_post’ );
$role->add_cap( ‘org_edit_published_posts’ );
$role->add_cap( ‘org_delete_published_posts’ );
$role->add_cap( ‘org_edit_published_posts’ );
$role->add_cap( ‘org_edit_private_posts’ );
$role->add_cap( ‘org_read_private_posts’ );}
add_action( ‘admin_init’, ‘add_event_caps’);//Change title pre-fill text for organization page to “Service Name”
function change_default_title( $title ){
$screen = get_current_screen();if ( $screen->post_type == ‘organization-listing’ ) {
return ‘Service Name’;
}
}add_filter( ‘enter_title_here’, ‘change_default_title’ );
Forum: Plugins
In reply to: [Custom Post Type UI] Issue with Capability TypeThanks for your help. I figured out a solution to my issue.
Forum: Plugins
In reply to: [Custom Post Type UI] Issue with Capability TypeI deactivated the plugin, but the custom post type still doesn’t show up in the menu when I change the the Custom Post Type’s Capability type, so I think it’s an issue with the CPT UI. The reason I mentioned the other plugin is because the Capability Type field in CPT UI allows me to change the capabilities when using another plugin.
Forum: Plugins
In reply to: [Custom Post Type UI] Issue with Capability TypeScreen shots:
https://indiaelder.sites.uofmhosting.net/trouble-shooting-cpt-ui/Thanks!
Forum: Plugins
In reply to: [Custom Post Type UI] Issue with Capability TypeI’m using another plugin, user role editor, to specify the capabilities. Yet to get a CPT UI custom post type to show in User Role Editor’s list of posts etc. separate from a normal post, you can need to add in unique name in CPT UI’s Capability Type field.
That works, but for some reason changing The Capability Type from “post” –> “my-name” makes the my custom post type disappear from the main WP menu, making the Capability Type field unusable. I’ll try to get some screen shots to explain better if I’m not being clear.
Thank you! I wish I waited. I decided to just reinstall (Luckily there wasn’t a lot of content…)