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
Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /var/www/wpfrontier.com/public_html/wp-content/plugins/frontier-buttons/include/frontier-buttons-hooks.php:395 Stack trace: #0 /var/www/wpfrontier.com/public_html/wp-content/plugins/frontier-buttons/include/frontier-buttons-hooks.php(395): implode(Array, ',') #1 /var/www/wpfrontier.com/public_html/wp-includes/class-wp-hook.php(324): frontier_buttons_teeny_init(Array, 'comment') #2 /var/www/wpfrontier.com/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #3 /var/www/wpfrontier.com/public_html/wp-includes/class-wp-editor.php(804): apply_filters('teeny_mce_befor...', Array, 'comment') #4 /var/www/wpfrontier.com/public_html/wp-includes/class-wp-editor.php(312): _WP_Editors::editor_settings('comment', Array) #5 /var/www/wpfrontier.com/public_html/wp-includes/general-template.php(3971): _WP_Editors::editor('', 'comment', Array) #6 /var/www/wpfrontier.com/public_html/wp-content/plugins/frontier-buttons/include/frontier-buttons-hooks.php(468): wp_editor('', 'comment', Array) #7 /var/www/wpfrontier.com/public_html/wp-includes/class-wp-hook.php(324): frontier_buttons_comments_editor(Array) #8 /var/www/wpfrontier.com/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #9 /var/www/wpfrontier.com/public_html/wp-includes/comment-template.php(2681): apply_filters('comment_form_de...', Array) #10 /var/www/wpfrontier.com/public_html/wp-content/themes/weaver-xtreme/comments.php(89): comment_form() #11 /var/www/wpfrontier.com/public_html/wp-includes/comment-template.php(1631): require('/var/www/wpfron...') #12 /var/www/wpfrontier.com/public_html/wp-content/themes/weaver-xtreme/single.php(55): comments_template('/comments.php', true) #13 /var/www/wpfrontier.com/public_html/wp-includes/template-loader.php(113): include('/var/www/wpfron...') #14 /var/www/wpfrontier.com/public_html/wp-blog-header.php(19): require_once('/var/www/wpfron...') #15 /var/www/wpfrontier.com/public_html/index.php(17): require('/var/www/wpfron...') #16 {main} thrown in /var/www/wpfrontier.com/public_html/wp-content/plugins/frontier-buttons/include/frontier-buttons-hooks.php on line 395