-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Variable admin notices based on user level.
By default the following logic will be used: User < `'publish_posts'` (=Author): no admin notices User < install/update/activate: "contact administrator notice" without disclosing information about the plugins involved and only if there are *required* plugins which require action. User = install/update/activate: "normal" notices The minimum user level for which admin notices are shown at all can be adjusted by using the newly introduced `tgmpa_show_admin_notice_capability` filter. The default capability is set to `'publish_posts'`. Example: add_filter( 'tgmpa_show_admin_notice_capability', create_function( '$cap', 'return \'edit_pages\';' ) ); Another example: To only show the admin notices to network admins on multisite, set it to a super admin capability like `'manage_network_plugins'`. Note: the `notices()` function is ugly and in desperate need of refactoring, that is not handled in this PR (which only makes it worse). Fixes #190, #414 Supersedes: https://github.com/INN/Largo/pull/740/files Partially fixes #479, #489 - notice will now only show for required updates for non-admin users with level author or editor. Possibly fixes #492, though more information is needed on the actual case.
- Loading branch information
Showing
2 changed files
with
107 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters