summaryrefslogtreecommitdiff
blob: 6b5d83c7ec10ef9656dde53db5011c742bb749e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Module Name: Sharing
 * Module Description: Add Twitter, Facebook and Google+ buttons at the bottom of each post, making it easy for visitors to share your content.
 * Sort Order: 7
 * Recommendation Order: 6
 * First Introduced: 1.1
 * Major Changes In: 1.2
 * Requires Connection: No
 * Auto Activate: No
 * Module Tags: Social, Recommended
 * Feature: Engagement
 * Additional Search Queries: share, sharing, sharedaddy, social buttons, buttons, share facebook, share twitter, social media sharing, social media share, social share, icons, email, facebook, twitter, linkedin, pinterest, pocket, social widget, social media
 *
 * @package Jetpack
 */

if ( ! function_exists( 'sharing_init' ) ) {
	require dirname( __FILE__ ) . '/sharedaddy/sharedaddy.php';
}

add_action( 'jetpack_modules_loaded', 'sharedaddy_loaded' );

/**
 * Sharing module code loaded after all modules have been loaded.
 */
function sharedaddy_loaded() {
	Jetpack::enable_module_configurable( __FILE__ );
	add_filter( 'jetpack_module_configuration_url_sharedaddy', 'jetpack_sharedaddy_configuration_url' );
}

/**
 * Return Jetpack Sharing configuration URL
 *
 * @return string Sharing config URL
 */
function jetpack_sharedaddy_configuration_url() {
	if ( Jetpack::is_development_mode() || Jetpack::is_staging_site() || ! Jetpack::is_user_connected() ) {
		return admin_url( 'options-general.php?page=sharing' );
	}

	$site_suffix = Jetpack::build_raw_urls( get_home_url() );
	return 'https://wordpress.com/marketing/sharing-buttons/' . $site_suffix;
}