Change capability name to make more sense

This commit is contained in:
Tetrakern 2023-09-18 10:41:21 +02:00
parent 4f4f20082e
commit 979c8d54f5
3 changed files with 7 additions and 7 deletions

View File

@ -609,7 +609,7 @@ The integrated role manager to add and, edit, and remove roles. Not the most sop
* **Story Pages:** Allows you to attach up to four pages to your stories as extra tabs.
* **Edit Date:** Makes it possible to change the publishing date *after* publishing.
* **Reduced Profile:** Removes clutter from the admin profile page, like the color schemes.
* **Edit Only Others Comments:** Limits moderators to only editing comments, not all posts.
* **Only Moderate Comments:** Limits moderators to only editing comments, not all posts.
* **Upload Limit:** Enforce the file size limit from the General Settings.
* **Upload Restrictions:** Enforce the file type restrictions from the General Settings.
* **Adminbar Access:** Overrides individual settings to show or hide the adminbar.

View File

@ -108,7 +108,7 @@ function fictioneer_setup_roles() {
// Administrator
$administrator = get_role( 'administrator' );
$administrator->remove_cap( 'fcn_edit_only_others_comments' );
$administrator->remove_cap( 'fcn_only_moderate_comments' );
$administrator->remove_cap( 'fcn_reduced_profile' );
$administrator->remove_cap( 'fcn_allow_self_delete' );
$administrator->remove_cap( 'fcn_upload_limit' );
@ -318,7 +318,7 @@ function fictioneer_add_moderator_role() {
'delete_others_posts' => true,
'fcn_admin_panel_access' => true,
'fcn_adminbar_access' => true,
'fcn_edit_only_others_comments' => true,
'fcn_only_moderate_comments' => true,
'fcn_upload_limit' => true,
'fcn_upload_restrictions' => true,
'fcn_show_badge' => true,
@ -653,8 +653,8 @@ if ( ! current_user_can( 'manage_options' ) ) {
* @since Fictioneer 5.6.0
*
* @param array $all_caps An array of all the user's capabilities.
* @param array $cap Primitive capabilities that are being checked.
* @param array $args Arguments passed to the capabilities check.
* @param array $cap Primitive capabilities that are being checked.
* @param array $args Arguments passed to the capabilities check.
*
* @return array Modified capabilities array.
*/
@ -677,7 +677,7 @@ if ( ! current_user_can( 'manage_options' ) ) {
return $all_caps;
}
if ( current_user_can( 'moderate_comments' ) && current_user_can( 'fcn_edit_only_others_comments' ) ) {
if ( current_user_can( 'moderate_comments' ) && current_user_can( 'fcn_only_moderate_comments' ) ) {
add_filter( 'user_has_cap', 'fictioneer_edit_only_comments', 10, 3 );
}

View File

@ -42,7 +42,7 @@ $editor_caps = array(
$restrictions = array(
'fcn_reduced_profile',
'fcn_edit_only_others_comments',
'fcn_only_moderate_comments',
'fcn_upload_limit',
'fcn_upload_restrictions',
'fcn_classic_editor'