Don't show the incentive page if the user can't manage WC

This commit is contained in:
Vlad Olaru 2024-09-19 13:08:52 +03:00
parent 6fe5cba053
commit e72756b0eb
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -63,6 +63,11 @@ class WcPayWelcomePage {
return false; return false;
} }
// The current WP user must have the capabilities required to set up WooPayments.
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return false;
}
// Suggestions not disabled via a setting. // Suggestions not disabled via a setting.
if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) { if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) {
return false; return false;