WPIntell

Source evidence

Super Admin Override

Toggle Meta Boxes · support · 2014-02-19T20:50:00+00:00

complaintsentiment
mediumseverity
0.69relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 35 rows with source links

14.3% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

30 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
trawp unresolved
Thank you for the great plugin. Comment editing is disabled for Super Admin. Can this be overridden so Super Admin can clean up if needed? Thanks Terri https://wordpress.org/plugins/toggle-meta-boxes-sitewide/ Yeah, something was bjorked in my code there. Needed a fine tuning, tanx. You can toggle whether any restrictions apply to the super admin with the first checkbox. “Super Admin gets the following limited meta boxes, too?” But then you could just toggle the comment editing restriction if you want a temporary workaround – which is what I do. The restrictions really only curb authors from editing others’ comments. If they are already an admin of the blog, they can still moderate another’s comments, but the link to edit it is hidden. Check for an update soon. Here are the code revisions if you want to get ahead of me. //Comment Editing Restrictions // http://scribu.net/wordpress/prevent-blog-authors-from-editing-comments.html function ds_network_admin_restrict_comment_editing( $caps, $cap, $user_id, $args ) { $menu_perms = get_site_option( "menu_items" ); if( !isset($menu_perms[ 'super_admin_mb' ] ) && is_super_admin()) return $caps; if( isset($menu_perms[ 'comment_edit' ]) ) { if ( 'edit_comment' == $cap ) { $comment = get_comment( $args[0] ); if ( is_super_admin( $comment->user_id ) ) $caps[] = 'manage_network'; //NetworkAdmin is only role that can edit this comment - no user can approve or trash it either! if ( ! is_super_admin( $comment->user_id ) && $comment->user_id != $user_id ) $caps[] = 'moderate_comments'; //NetworkAdmin, Admins, Editors roles can edit others comments } } return $caps; } function ds_remove_comment_edit($actions, $comment) { $menu_perms = get_site_option( "menu_items" ); if( !isset($menu_perms[ 'super_admin_mb' ] ) && is_super_admin()) return $actions; if( isset($menu_perms[ 'comment_edit' ]) ) { $user_id = get_current_user_id(); if ($comment->user_id != $user_id) { unset($actions['edit']); // edit link appears only on own comments unset($actions['quickedit']); //quickedit may already be toggled for all roles } } return $actions; }

Comments

1 shown
David Sader 2014-02-21T03:28:00+00:00

Yeah, something was bjorked in my code there. Needed a fine tuning, tanx. You can toggle whether any restrictions apply to the super admin with the first checkbox. “Super Admin gets the following limited meta boxes, too?” But then you could just toggle the comment editing restriction if you want a temporary workaround – which is what I do. The restrictions really only curb authors from editing others’ comments. If they are already an admin of the blog, they can still moderate another’s comments, but the link to edit it is hidden. Check for an update soon. Here are the code revisions if you want to get ahead of me. //Comment Editing Restrictions // http://scribu.net/wordpress/prevent-blog-authors-from-editing-comments.html function ds_network_admin_restrict_comment_editing( $caps, $cap, $user_id, $args ) { $menu_perms = get_site_option( "menu_items" ); if( !isset($menu_perms[ 'super_admin_mb' ] ) && is_super_admin()) return $caps; if( isset($menu_perms[ 'comment_edit' ]) ) { if ( 'edit_comment' == $cap ) { $comment = get_comment( $args[0] ); if ( is_super_admin( $comment->user_id ) ) $caps[] = 'manage_network'; //NetworkAdmin is only role that can edit this comment - no user can approve or trash it either! if ( ! is_super_admin( $comment->user_id ) && $comment->user_id != $user_id ) $caps[] = 'moderate_comments'; //NetworkAdmin, Admins, Editors roles can edit others comments } } return $caps; } function ds_remove_comment_edit($actions, $comment) { $menu_perms = get_site_option( "menu_items" ); if( !isset($menu_perms[ 'super_admin_mb' ] ) && is_super_admin()) return $actions; if( isset($menu_perms[ 'comment_edit' ]) ) { $user_id = get_current_user_id(); if ($comment->user_id != $user_id) { unset($actions['edit']); // edit link appears only on own comments unset($actions['quickedit']); //quickedit may already be toggled for all roles } } return $actions; }