WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Custom Post Types being saved as draft by default (9 posts)

  1. iwildeachit
    Member
    Posted 2 years ago #

    I have a Formidable Pro form set up to create a Custom Post Type. When anyone posts a new entry, the post is being saved as a draft by default. Is there a way I can set this to publish by default? I'm not sure if it's something in my user permissions or something in the way custom post types work. Any input would be greatly appreciated. My default user level is contributor and they have the ability to edit and publish posts.

    Thanks

    http://wordpress.org/extend/plugins/custom-post-type-ui/

  2. Ov3rfly
    Member
    Posted 2 years ago #

    Did you enter anything other than 'post' in Custom Post Type UI -> Manage Custom Post Types -> Edit (your custom type) -> Advanced Options -> Capability Type?

    Note: If you entered something else, it will be saved in database but still show 'post' because of a bug in current version of Custom Post Type UI.

    To inherit the rights of 'post', make sure that you enter 'post' there and save again.

  3. iwildeachit
    Member
    Posted 2 years ago #

    All I have had in the field so far was 'post'. I tried creating a new post under my 'topic' custom post type, but it still shows up as a draft in the users backend. I'm lost.

  4. Ov3rfly
    Member
    Posted 2 years ago #

    1. Is your user the owner of the 'topic' post?

    2. How do you grant 'ability to edit and publish posts' rights to your contributors? With a plugin? Or with add_cap()?

  5. iwildeachit
    Member
    Posted 2 years ago #

    1. The correct author's name is being displayed for the post owner in the dashboard.

    2. I am using the User Role Editor plugin from : http://www.shinephp.com/user-role-editor-wordpress-plugin/

    Here is a cap of my contributor role permissions: http://i39.tinypic.com/16a6rls.png

  6. Ov3rfly
    Member
    Posted 2 years ago #

    The contributor role permissions look ok, it should work like this, but I am not familiar with how User Role Editor sets the permissions internally.

    I have a similar setup on one of my sites, but I do not use a plugin for the roles, I have this in my functions.php and contributors can publish posts in my custom post types.

    $role = get_role('contributor');
    if ($role !== NULL) {
    	if (!$role->has_cap('upload_files'))  $role->add_cap('upload_files');
    	if (!$role->has_cap('publish_posts')) $role->add_cap('publish_posts');
    	if (!$role->has_cap('edit_published_posts')) $role->add_cap('edit_published_posts');
    }
  7. iwildeachit
    Member
    Posted 2 years ago #

    I added the function to my functions.php file and disabled my roles plugin and Custom Post Types are still being saved as drafts upon creation. Any more ideas?

  8. Ov3rfly
    Member
    Posted 2 years ago #

    Note: If you re-enable the User Role Editor, don't forget to delete the code in functions.php

    As I wrote before, it could be some issue with the "Capability Type", to check this, I would add another fresh custom post type, just for testing.

    Or maybe you have some other plugin which causes the behaviour.

  9. iwildeachit
    Member
    Posted 2 years ago #

    After all that, it ended up being the form plugin that was giving me problems. It's not a bug or anything with the plugin, I just forgot to add a required field.

    What is the emoticon for blushing? :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic