2013-09-04 1 views
0

이 테마는 http://pixelgeeklab.com/wp-realestast/#all으로 구입했으며 WordPress에 새로운 사용자 롤을 추가하여 방문자가 웹 사이트에 등록하고 자신의 부동산을 추가 할 수 있도록했습니다.WordPress에 사용자 정의 게시물을 추가 할 수있는 새로운 사용자 롤 추가

내가 수동으로 코딩 시도했지만 thah가 많은 일입니다 실현 내가 회원 저스틴 Tadlock에 의해 플러그인을 사용하여 시도 (http://wordpress.org/plugins/members/)

내 문제는 내가 보거나 편집 할 만 모든 게시물을 가능하게 할 수 있다는 것입니다

하지만, 편집 할 수 없으므로 방문자는 ESTATES라는 맞춤 게시 유형에만 액세스 할 수 있습니다.

밑에는 functions.php의 코드를 (누군가가이 문제를 확인하고 코드, 나는 매우 감사하게 될 것입니다 취소 할 수 그래서 만약 내가 많이 시도) 찾기 :

add_action('init', 'wptuts_getrole'); 

function wptuts_getrole() { 
    $role = get_role('seller'); 
    echo '<pre>'; 
    var_dump($role); 
    echo '</pre>'; 
} 

add_action('init', 'ct_add_role'); 
function ct_add_role() { 

$role = get_role('seller'); 
$role->remove_cap('edit_posts'); 
    $role->add_cap('read'); 
    $role->add_cap('manage_options'); 
    $role->add_cap('publish_posts'); 
    $role->add_cap('add_estates'); 
    $role->add_cap('edit_estate'); 

/*add_role('seller', 'Seller', array(
    'read' => true, 
    'add_posts'=> false, 
    'publish_posts' => false, 
    'edit_posts' => false, 
    'delete_posts' => false, 
    'add_estate'=> false, 
    'manage_options'=>false, 
));*/ 
//} 

그리고 estates.php의 코드를 :

당신이 필요로하는이 플러그인을 시도 할 수

답변

0

, 그것은 모든 일을해야

/** 
* ##################################### 
* Actions 
* ##################################### 
*/ 
static function register() { 
    $args = array(
     'labels'  => array(
      'name'   => 'Estates', 
      'singular_name' => 'Estate', 
     ), 
     'description' => __('This post type is used in RealEstast theme', PGL), 
     'public'  => TRUE, 
     'show_ui'  => TRUE, 
     'hierarchical' => FALSE, 
     /* 'capability_type' => 'post', 
     'capability' => array(
      'add_posts' => 'add_estates', 
      'publish_posts' => 'publish_estates', 
      'edit_posts' => 'edit_estates', 
      'edit_others_posts' => 'edit_others_estates', 
      'delete_posts' => 'delete_estates', 
      'delete_others_posts' => 'delete_others_estates', 
      'read_private_posts' => 'read_private_estates', 
      'edit_post' => 'edit_estate', 
      'delete_post' => 'delete_estate', 
      'read_post' => 'read_estate', 
     ),*/ 
     'supports'  => array(
      'title', 
      'editor', 
      'thumbnail', 
     ), 
     'has_archive' => TRUE, 
     'rewrite'  => array(
      'slug'  => 'estate', 
      'with_front' => TRUE 
     ), 
    ); 
    register_post_type('estate', $args); 
http://wordpress.org/plugins/advanced-access-manager/

관련 문제