kollapsminoriteten/wp-content/plugins/jetpack/modules/sharedaddy.php

48 lines
1.5 KiB
PHP
Raw Normal View History

2019-11-15 23:26:29 +01:00
<?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
*/
2020-05-06 17:20:49 +02:00
use Automattic\Jetpack\Redirect;
2020-12-10 14:04:11 +01:00
use Automattic\Jetpack\Status;
2020-03-03 18:49:45 +01:00
2019-11-15 23:26:29 +01:00
if ( ! function_exists( 'sharing_init' ) ) {
2020-12-10 14:04:11 +01:00
require __DIR__ . '/sharedaddy/sharedaddy.php';
2019-11-15 23:26:29 +01:00
}
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() {
2020-03-03 18:49:45 +01:00
$status = new Status();
2020-09-15 14:30:05 +02:00
if ( $status->is_offline_mode() || $status->is_staging_site() || ! Jetpack::is_user_connected() ) {
2019-11-15 23:26:29 +01:00
return admin_url( 'options-general.php?page=sharing' );
}
2020-05-06 17:20:49 +02:00
return Redirect::get_url( 'calypso-marketing-sharing-buttons' );
2019-11-15 23:26:29 +01:00
}