Changeset 1666303
- Timestamp:
- 05/29/2017 08:47:11 AM (9 years ago)
- Location:
- sharing-club/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
sharing-club.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sharing-club/trunk/readme.txt
r1662392 r1666303 60 60 61 61 == Changelog == 62 = 1.2 = 63 - Fixed the capabilities bug for admin. 64 - Added dutch translation (thanks again Jeroen). 65 62 66 = 1.1 = 63 67 - For each object, you can use the "excerpt" field to write a short note for admin purpose (ie : library reference, useful comment) to help you manage your objects -
sharing-club/trunk/sharing-club.php
r1662346 r1666303 5 5 Description: Share books, dvd, tools, toys or any object with your friends or community. Your users can easily lend, borrow and rate items while you keep a track of what is shared and who borrowed what. 6 6 Author: Manu Z. 7 Version: 1. 17 Version: 1.2 8 8 Author URI: http://netdelight.be/ 9 9 Text Domain: sharing-club … … 61 61 register_activation_hook( __FILE__, 'scwp_plugin_activate' ); 62 62 63 function scwp_ admin_init() {63 function scwp_init() { 64 64 //if ( current_user_can( 'manage_options' ) ) { 65 65 $object = array( … … 80 80 'public' => true, 81 81 'publicly_queryable' => true, 82 // meta capabilities (enable roles customization) 83 // see https://wordpress.stackexchange.com/questions/14553/allow-member-to-have-access-to-custom-post-type-only-permission-to-only-edit-th 84 'capability_type' => 'shared_item', 85 'map_meta_cap' => true, 82 'has_archive' => true, 83 'rewrite' => array('slug' => 'shared_item'), 86 84 'supports' => array( 87 85 'title', … … 91 89 'custom-fields' 92 90 ), 93 'has_archive' => true, 94 'rewrite' => array('slug' => 'shared_item') 95 ); 91 // meta capabilities (enable roles customization) 92 // see https://wordpress.stackexchange.com/questions/14553/allow-member-to-have-access-to-custom-post-type-only-permission-to-only-edit-th 93 'capability_type' => 'shared_item', 94 'capabilities' => array( 95 'edit_post' => 'edit_shared_item', 96 'edit_posts' => 'edit_shared_item', 97 'edit_others_posts' => 'edit_other_shared_item', 98 'publish_posts' => 'publish_shared_item', 99 'read_post' => 'read_shared_item', 100 'read_private_posts' => 'read_private_shared_item', 101 'delete_post' => 'delete_shared_item', 102 'delete_posts' => 'delete_shared_item' 103 ), 104 ); 105 106 function scwp_admin_init(){ 107 $role = get_role( 'administrator' ); 108 $role->add_cap( 'publish_shared_item' ); 109 $role->add_cap( 'edit_shared_item' ); 110 $role->add_cap( 'edit_others_shared_item' ); 111 $role->add_cap( 'delete_shared_item' ); 112 $role->add_cap( 'delete_others_shared_item' ); 113 $role->add_cap( 'read_private_shared_item' ); 114 } 115 116 add_action('admin_init', 'scwp_admin_init'); 117 96 118 register_post_type('shared_item', $object); 97 119 … … 126 148 //} 127 149 } 128 add_action('init', 'scwp_admin_init'); 129 150 add_action('init', 'scwp_init'); 130 151 131 152 function scwp_display_lending_table(){
Note: See TracChangeset
for help on using the changeset viewer.