PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 7.5.6
Jetpack – WP Security, Backup, Speed, & Growth v7.5.6
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / publicize.php

publicize.php in Jetpack – WP Security, Backup, Speed, & Growth 7.5.6, at modules/publicize.php

75 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: Publicize
4 * Module Description: Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.
5 * Sort Order: 10
6 * Recommendation Order: 7
7 * First Introduced: 2.0
8 * Requires Connection: Yes
9 * Auto Activate: No
10 * Module Tags: Social, Recommended
11 * Feature: Engagement
12 * Additional Search Queries: facebook, jetpack publicize, twitter, tumblr, linkedin, social, tweet, connections, sharing, social media, automated, automated sharing, auto publish, auto tweet and like, auto tweet, facebook auto post, facebook posting
13 */
14
15 class Jetpack_Publicize {
16
17 public $in_jetpack = true;
18
19 function __construct() {
20 global $publicize_ui;
21
22 $this->in_jetpack = ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'enable_module_configurable' ) ) ? true : false;
23
24 if ( $this->in_jetpack ) {
25 Jetpack::enable_module_configurable( __FILE__ );
26 }
27
28 require_once dirname( __FILE__ ) . '/publicize/publicize.php';
29
30 if ( $this->in_jetpack )
31 require_once dirname( __FILE__ ) . '/publicize/publicize-jetpack.php';
32 else {
33 require_once dirname( dirname( __FILE__ ) ) . '/mu-plugins/keyring/keyring.php';
34 require_once dirname( __FILE__ ) . '/publicize/publicize-wpcom.php';
35 }
36
37 require_once dirname( __FILE__ ) . '/publicize/ui.php';
38 $publicize_ui = new Publicize_UI();
39 $publicize_ui->in_jetpack = $this->in_jetpack;
40
41 // Jetpack specific checks / hooks
42 if ( $this->in_jetpack ) {
43 // if sharedaddy isn't active, the sharing menu hasn't been added yet
44 $active = Jetpack::get_active_modules();
45 if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
46 add_action( 'admin_menu', array( &$publicize_ui, 'sharing_menu' ) );
47 }
48 }
49 }
50 }
51
52 global $publicize_ui;
53 new Jetpack_Publicize;
54
55 if( ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) && ! function_exists( 'publicize_init' ) ) {
56 /**
57 * Helper for grabbing a Publicize object from the "front-end" (non-admin) of
58 * a site. Normally Publicize is only loaded in wp-admin, so there's a little
59 * set up that you might need to do if you want to use it on the front end.
60 * Just call this function and it returns a Publicize object.
61 *
62 * @return Publicize Object
63 */
64 function publicize_init() {
65 global $publicize;
66
67 if ( ! class_exists( 'Publicize' ) ) {
68 require_once dirname( __FILE__ ) . '/publicize/publicize.php';
69 }
70
71 return $publicize;
72 }
73
74 }
75