• Resolved jli

    (@jli)


    The feature list says:

    Supports custom Post Types and Taxonomies (when defined using WP schema by a plugin such as Custom Post Type UI)

    Is there a way to get the “regular” hardcoded custom post types working with Role Scoper ?

    I don’t like the idea of having to rely on a plugin to create my custom post types.

    Thanks,
    John.

    https://www.ads-software.com/extend/plugins/role-scoper/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Kevin Behrens

    (@kevinb)

    I am referring to “regular” custom post types. The only reason I mentioned a plugin is that WP does not currently provide the UI to create/edit custom types, and a lot of people wouldn’t know how to hardcode their own definitions.

    Thread Starter jli

    (@jli)

    Well then there is a bug with hardcoded custom post types.

    In the Realm pannel -> Object Scope, I can see my hardcoded custom post types in the list of available items.
    But if i check the checkbox in front of one of them and save, my selection is not saved.

    I did the test with a custom post types created with Custom post types UI and it’s working.

    Any hint ?
    Don’t hesitate to ask if you want more infos to debug ??

    Plugin Author Kevin Behrens

    (@kevinb)

    Make sure you register your post types early on the init action:

    function my_post_types() {
      register_post_type( .... );
    }
    
    add_action( 'init', 'my_post_types', 1 );

    That should help but I’ve been working on custom types / taxonomies support today and did discover a number of other glitches. Will let you know when I have another version stabilized.

    Thread Starter jli

    (@jli)

    Hey Kevin,

    I’m a step further now, I can save my selection in the object scope settings and my custom post types appear in the roles and restrictions panels.

    Now that I can access my CPT in roles and restictions, I don’t see any entry in the role table of each CPT.

    See this image : https://screencast.com/t/MzcxZGQ1Z

    Maybe I’m missing something in the config or maybe it’s the glitches you mentioned earlier ??

    Anyway thanks for the support!

    Plugin Author Kevin Behrens

    (@kevinb)

    I just pushed a 1.2.8.beta up to www.ads-software.com. Let me know if your custom type roles can now be assigned once they are activated in Roles < Options > Realm.

    There may still be other glitches with custom post types in that code base. Let me know if any of them are killers and maybe I can backport more code from my version 1.3 development. In general, I’ve found that with custom post types here to stay, requiring WP 3.0 is my only sane approach to manageable code. So RS 1.3 will introduce that requirement along with code that’s optimized for it.

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    I’m having the same issue with not being able to save my checkbox selection in front of a custom post type. jli – did you do anything specific to get it working?

    Plugin Author Kevin Behrens

    (@kevinb)

    See the comment above about registering post types on the init action. Find the equivalent add_action( ‘init’ code in your theme or plugin and make sure that line ends with , 1 );

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    I did make sure to set the priority to 1, but still not working for me. Any other reason it wouldn’t save the checkbox selection?

    Thread Starter jli

    (@jli)

    @helenyhou: here is a sample of my code

    add_action('init', 'hotel_register',1);
    
    	function hotel_register(){
    		$args = array(
    			'label' => __('Hotels'),
    			'singular_label' => __('Hotel'),
    			'public' => true,
    			'hierarchical' => false,
    			'rewrite' => true,
    			'supports' => array('title', 'editor', 'revisions', 'author', 'thumbnail'),
    			);
    		register_post_type( 'hotel' , $args );
    	}

    I only added the priority one as Kevin stated.

    @kevinb: I still had no time to check the beta’s deeply but i’ll report any glitches if i found some ??

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    Well, I did some more investigating and it looks like no options under Realm save for me, although options under other tabs are. I will try deactivating other plugins to see if there is a conflict out there and report back. Where/how are these options saved?

    Update: Tried deactivating all plugins and removing all functions except initializing the custom post type, but options were still not saved. This is crucial to our site development – any other ideas?

    Plugin Author Kevin Behrens

    (@kevinb)

    What RS version are you running?

    What WP version? Multisite?

    Can you post your type registration function or let me know what plugin is registering it for you?

    The Realm options are saved in submittee.php – function update_page_otype_options

    Plugin Author Kevin Behrens

    (@kevinb)

    Never mind answering those last questions.

    I confirmed that those options don’t save correctly under WP 3.0 Multisite when they are configured as site_wide options.

    Can you confirm this is fixed in Role Scoper 1.2.8 Beta 4 ?

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    Yes, this is fixed for site_wide options in beta 4! This is great – thank you so much.

    Now, when I set a user to have a role (i.e. be an editor) for a specific post of a custom type (a faculty member, in my case), the custom post type does not show in the admin menu, although the user can indeed update the post itself when the URL for the post to edit is navigated to. If I set the user to only be an editor for a page, however, the page menu does show up. Is there something I need to set in order for the custom post type admin menu to appear?

    Plugin Author Kevin Behrens

    (@kevinb)

    Okay, I’ve also confirmed the failure to display a custom post type menu based on object role assignment. This is now fixed in Role Scoper 1.2.8 Beta 5, which is in the process of uploading to www.ads-software.com right now.

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    You are really and truly fantastic. As far as I can tell for the moment, everything I need is working perfectly! Your plugin is the backbone of justification for my current WP-as-CMS project, and I can’t thank you enough for the work that you do. I’ll keep an eye out for any other funky occurrences, but for now, thank you!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: Role Scoper] Custom post type without WP Schema support’ is closed to new replies.