Frontier Post – Who can add a post
Below are the rules for adding a post.
The rules are based on a combination of Frontier Post settings & Capabilities:
- User has Capability: frontier_post_can_add
- That it is an allowed post type (Setting: Allowed Post Types)
- It is a valid post type
Code:
function frontier_can_add($tmp_post_type = "NONE") { global $fps_access_check_msg; $tmp_can_do = true; if ( !current_user_can( 'frontier_post_can_add' ) ) { $tmp_can_do = false; $fps_access_check_msg .= __("You are not allowed to add new posts", "frontier-post")."<br>"; } // Always allow the boss if ( current_user_can( 'administrator' ) ) { $tmp_can_do = true; $fps_access_check_msg = ""; } // check if it is an allowed posttype if ( !fp_check_post_type($tmp_post_type) ) { $tmp_can_do = false; $fps_access_check_msg .= __("You are not allowed to add new post type", "frontier-post").": ".$tmp_post_type; $fps_access_check_msg .= " - Allowed: (".implode(", ", fp_default_post_type_list()).")<br>"; } // check if posttype exists if ( !post_type_exists($tmp_post_type) ) { $tmp_can_do = false; $fps_access_check_msg .= __("Post type does not exists", "frontier-post").": ".$tmp_post_type."<br>"; } return $tmp_can_do; }
Comments
Frontier Post – Who can add a post — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>