summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy/sharing-service.php')
-rw-r--r--plugins/jetpack/modules/sharedaddy/sharing-service.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharing-service.php b/plugins/jetpack/modules/sharedaddy/sharing-service.php
index a3a3e6d8..8f53838e 100644
--- a/plugins/jetpack/modules/sharedaddy/sharing-service.php
+++ b/plugins/jetpack/modules/sharedaddy/sharing-service.php
@@ -44,7 +44,6 @@ class Sharing_Service {
// if you update this list, please update the REST API tests
// in bin/tests/api/suites/SharingTest.php
$services = array(
- 'email' => 'Share_Email',
'print' => 'Share_Print',
'facebook' => 'Share_Facebook',
'linkedin' => 'Share_LinkedIn',
@@ -60,6 +59,20 @@ class Sharing_Service {
'skype' => 'Share_Skype',
);
+ /**
+ * Filters if Email Sharing is enabled.
+ *
+ * E-Mail sharing is often problematic due to spam concerns, so this filter enables it to be quickly and simply toggled.
+ * @module sharedaddy
+ *
+ * @since 5.1.0
+ *
+ * @param bool $email Is e-mail sharing enabled? Default false if Akismet is not active or true if Akismet is active.
+ */
+ if ( apply_filters( 'sharing_services_email', Jetpack::is_akismet_active() ) ) {
+ $services['email'] = 'Share_Email';
+ }
+
if ( $include_custom ) {
// Add any custom services in
$options = $this->get_global_options();
@@ -176,8 +189,10 @@ class Sharing_Service {
* @see https://github.com/Automattic/jetpack/issues/6121
*/
if ( ! is_array( $options ) || ! isset( $options['button_style'], $options['global'] ) ) {
- $global_options = $this->get_global_options();
- $options = array_merge( is_array( $options ) ? $options : array(), $global_options );
+ $global_options = array( 'global' => $this->get_global_options() );
+ $options = is_array( $options )
+ ? array_merge( $options, $global_options )
+ : $global_options;
}
$global = $options['global'];