Add setting to control display of marketplace suggestions.
This commit is contained in:
parent
437adec140
commit
4a2c706cc0
|
@ -178,6 +178,11 @@ class WC_Marketplace_Suggestions {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Suggestions may be disabled via a setting under Accounts & Privacy.
|
||||
if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// User can disabled all suggestions via filter.
|
||||
return apply_filters( 'woocommerce_allow_marketplace_suggestions', true );
|
||||
}
|
||||
|
|
|
@ -255,6 +255,26 @@ class WC_Settings_Accounts extends WC_Settings_Page {
|
|||
'type' => 'sectionend',
|
||||
'id' => 'tracking_options',
|
||||
),
|
||||
array(
|
||||
'title' => esc_html__( 'Marketplace suggestions', 'woocommerce' ),
|
||||
'type' => 'title',
|
||||
'id' => 'marketplace_suggestions',
|
||||
'desc' => __( 'We show contextual suggestions for official extensions that may be helpful to your store.', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show Suggestions', 'woocommerce' ),
|
||||
'desc' => __( 'Display suggestions within WooCommerce', 'woocommerce' ),
|
||||
'desc_tip' => esc_html__( 'Leave this box unchecked if you do not want to see suggested extensions.', 'woocommerce' ),
|
||||
'id' => 'woocommerce_show_marketplace_suggestions',
|
||||
'type' => 'checkbox',
|
||||
'checkboxgroup' => 'start',
|
||||
'default' => 'yes',
|
||||
'autoload' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'marketplace_suggestions',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue