Skip to content

Commit

Permalink
Limits CPT UI visibility to blog admins. Fixes #86
Browse files Browse the repository at this point in the history
git-svn-id: http://plugins.svn.wordpress.org/buddypress-docs/trunk@385465 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
boonebgorges committed May 16, 2011
1 parent 00adf0f commit aba3a0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bp-docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function register_post_type() {
'labels' => $post_type_labels,
'public' => false,
'_builtin' => false,
'show_ui' => true,
'show_ui' => $this->show_cpt_ui(),
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'revisions', 'excerpt', 'comments' ),
'query_var' => true,
Expand Down Expand Up @@ -219,6 +219,22 @@ function register_post_type() {
restore_current_blog();
}

/**
* Show the CPT Dashboard UI to the current user?
*
* Defaults to is_super_admin(), but is filterable
*
* @package BuddyPress Docs
* @since 1.0.8
*
* @return bool $show_ui
*/
function show_cpt_ui() {
$show_ui = is_super_admin();

return apply_filters( 'bp_docs_show_cpt_ui', $show_ui );
}

/**
* Loads the textdomain for the plugin
*
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This plugin is in active development. For feature requests and bug reports, visi
== Changelog ==

= 1.0.8 =
* Limited access to custom post type on the Dashboard to admins
* Added group Doc count to group tab
* Added Italian translation - Props Luca Camellini

Expand Down

0 comments on commit aba3a0e

Please sign in to comment.