Note that there are some explanatory texts on larger screens.

plurals
  1. PORegisitry post type wordpress
    text
    copied!<p>I registered a new post type &amp; named it as <strong><code>eassy</code></strong>.</p> <p>I also added two new users role, one is <strong>member_area</strong> and another one <strong>mentor_area</strong>. Now when <strong>member_area</strong> role users login to dashboard they have to see,edit,delete,publish only there own posts .. and they don't get control over other users posts.. </p> <p>but in case <strong>mentor_area</strong> users can see all <strong>member_area</strong> users posts,edit,delete, (full Control).</p> <p>Is this can be done with WordPress default functions or do i have to use plugins for this? can any one show me a example for this?..</p> <p>And i also want to know how to show only <strong>eassy</strong> post type link on left sidbar for member_area &amp; mentor_area dashboard.. </p> <pre><code>add_role ( 'member_area', 'Member Area', array ( 'read' =&gt; true ) ); add_role ( 'mentor_area', 'Mentor Area', array ( 'read' =&gt; true ) ); add_action ( 'init', 'create_my_post_types' ); function create_my_post_types() { $capabilities = array ( 'publish_posts' =&gt; 'publish_eassy', 'edit_posts' =&gt; 'edit_eassy', 'edit_others_posts' =&gt; 'edit_others_eassy', 'delete_posts' =&gt; 'delete_eassy', 'delete_others_posts' =&gt; 'delete_others_eassy', 'read_private_posts' =&gt; 'read_private_eassy', 'edit_post' =&gt; 'edit_eassy', 'delete_post' =&gt; 'delete_eassy', 'read_post' =&gt; 'read_eassy' ); register_post_type ( 'eassymamagment', array ( 'labels' =&gt; array ( 'name' =&gt; __ ( 'Eassy' ), 'singular_name' =&gt; __ ( 'eassymamagment' ) ), 'public' =&gt; true, 'capability_type' =&gt; 'eassymamagment', 'menu_position' =&gt; 6, 'capabilities' =&gt; $capabilities, 'rewrite' =&gt; array ( 'slug' =&gt; 'eassymamagment' ) ) ); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload