• i just modified some code for my need :
    Added a special profile :

    add_role( 'idea_submitter', 'Idea submitter', array( 'edit_idea','read_idea','publish_ideas' ) );
    
    function add_ideas_caps() {
        // gets the author administrator
        $role = get_role( 'administrator' );
    
        // This only works, because it accesses the class instance.
        // would allow the administrator to edit others' ideas
        $role->add_cap('publish_ideas');
        $role->add_cap('edit_ideas');
        $role->add_cap('edit_others_ideas');
        $role->add_cap('delete_ideas');
        $role->add_cap('delete_others_ideas');
        $role->add_cap('read_private_ideas');
        $role->add_cap('edit_idea');
        $role->add_cap('delete_idea');
        $role->add_cap('read_idea' );
        $role->add_cap('see_idea_author' );
        $role->add_cap('see_idea_excerpt');
        $role->add_cap('see_adminbar');
    
        $role2 = get_role('idea_submitter');
        $role2->add_cap('publish_ideas');
        $role2->add_cap('edit_idea');
    
    }
    add_action( 'admin_init', 'add_ideas_caps');

    and in the register post type :
    'capability_type' => 'idea',

    I also modified some views because i wanted an anonymous view of ideas for example.
    I Added a code for counting votes (see on http:/imathi.eu)

  • The topic ‘Nice plugin. i needed it for intranet use : very clean and usefull’ is closed to new replies.