Merged in feature/117-dev-dev01 (pull request #8)
auto-patch 117-dev-dev01-2023-12-15T16_09_06 * auto-patch 117-dev-dev01-2023-12-15T16_09_06
This commit is contained in:
@@ -175,7 +175,7 @@ class Core {
|
||||
}
|
||||
|
||||
// Plugin admin area notices. Display to "admins" only.
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
if ( current_user_can( wp_mail_smtp()->get_capability_manage_options() ) ) {
|
||||
add_action( 'admin_notices', array( '\WPMailSMTP\WP', 'display_admin_notices' ) );
|
||||
add_action( 'admin_notices', array( $this, 'display_general_notices' ) );
|
||||
|
||||
@@ -609,7 +609,7 @@ class Core {
|
||||
public function detect_conflicts() {
|
||||
|
||||
// Display only for those who can actually deactivate plugins.
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
if ( ! current_user_can( wp_mail_smtp()->get_capability_manage_options() ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1346,4 +1346,23 @@ class Core {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default capability to manage everything for WP Mail SMTP.
|
||||
*
|
||||
* @since 3.11.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_capability_manage_options() {
|
||||
|
||||
/**
|
||||
* Filters the default capability to manage everything for WP Mail SMTP.
|
||||
*
|
||||
* @since 3.11.0
|
||||
*
|
||||
* @param string $capability The default capability to manage everything for WP Mail SMTP.
|
||||
*/
|
||||
return apply_filters( 'wp_mail_smtp_core_get_capability_manage_options', 'manage_options' );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user