Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




custom post types not available unless "public"

UserPost

9:04 am
October 10, 2011


pheonixgh

Member

posts 3

1

I have three custom post types declared in my functions file, they are all registered in the same way by a function assigned to init with a priority of 1 as below,

add_action('init', 'post_type_xxx',1);

they all work correctly, relevant menus etc are visible and i can add/edit for me as admin since they all use

'capability_type'=>'post'

however two of them are not available within RS, as they do not show in the list of post types on Roles>options>realms

after some experimenting it seems that they will not appear here unless the 'public' meta argument for register post type is true, although it appears i can still override the component values (show_ui, publicly_queryable, exclude_from_search, show_in_nav_menus) individualy to whatever i like to achieve the desired results.
http://codex.wordpress.org/Function_Reference/register_post_type

this seems a little odd and unintuitive particularly since the 'public' arguments default value is false.

unless there is some other reason why they would not be appearing?

p.s. following debugging advice from another post i put a print_r of $wp_post_types in the

force_distinct_post_caps() function in role-scoper/wp-cap-helper_cr.php

the dump contained all of my custom post types.

10:09 am
October 10, 2011


Kevin

Admin

posts 2503

2

pheonixgh said:

this seems a little odd and unintuitive particularly since the 'public' arguments default value is false.


Others found it odd and unintuitive that filtering was not automatically enabled for their custom post types. So I made it automatic. But that put me on the hook for all manner of "Role Scoper interferes with Plugin X" reports due to background use of CPTs. So I decline to filter public=false types because that is the default value.

By the way, Role Scoper modifies the capabilities for enabled types such that capability_type => custom_type_name. Otherwise there is no way to apply type-specific roles site-wide or term-wide.

8:45 am
October 11, 2011


pheonixgh

Member

posts 3

3

makes perfect sense when you put it like that. thanks for the quick reponse and confirming i wasnt going mad.

perhaps public=false types could at least still appear in the RS interface under Roles>options>realms just not checked by default? perhaps even grouped seperately with an additional warning message? this should not break anything by default, but would give users the option to toggle filtering on without having to set public to true and other flags to whatever is required to actualy preserve their non public functionality which just seems odd.

Great plugin by the way, it is a must-have on most of my wordpress builds with more than a single user/editor.

2:39 pm
November 2, 2011


Kevin

Admin

posts 2503

4

I'll keep this in mind as a feature request but probably won't do it soon because quite a few RS get_post_types() and get_taxonomies() calls assume public-only.


About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1246

Posts: 5654

Members:

There are 1257 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin