Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have more than 1 TGMPA backend notification #492

Closed
JakeHenshall opened this issue Nov 2, 2015 · 1 comment · Fixed by #507
Closed

Have more than 1 TGMPA backend notification #492

JakeHenshall opened this issue Nov 2, 2015 · 1 comment · Fixed by #507

Comments

@JakeHenshall
Copy link

Hi,

I'm wondering if there would be a way to include 2 separate notifications in the backend. 1 for the User and One For Developer as i'm creating a Theme Framework.

Thanks Jake.

@WebTechGlobal
Copy link

It possible. The approach used might depend on the notification but most of the time we use WordPress functions related to capabilities now rather than an admin OR user approach. Each role has different capabilities. So your admin can see a different notification from authors and authors see something different from subscribers. Keep in mind, technically authors or any other role, may still be users of a server and purchase goods etc.

Can you confirm, you do mean ALL notifications or is there a specific one?

Also what difference do you want between those viewed by admin and other users?

jrfnl added a commit that referenced this issue Jan 5, 2016
By default the following logic will be used:
User < 'publish_posts': 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 is set to 'publish_posts', i.e. Authors.

Example:
add_filter( 'tgmpa_show_admin_notice_capability', create_function( '$cap', 'return \'edit_pages\';' ) );

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.
jrfnl added a commit that referenced this issue Jan 5, 2016
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.
jrfnl added a commit that referenced this issue Jan 5, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants