Skip to content

Commit

Permalink
Merge pull request #139 from Automattic/fix/global-declaration
Browse files Browse the repository at this point in the history
Declare Syndication globally in a more explicit way.
  • Loading branch information
philipjohn authored Dec 18, 2017
2 parents 08b6c42 + 49ee621 commit 374adf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions includes/class-wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private function _make_em_talk_push() {
return;

$this->enabled_verbosity = true;

add_filter( 'syn_pre_push_post_sites', function( $sites, $post_id, $slave_states ) {
WP_CLI::line( sprintf( "Processing post_id #%d (%s)", $post_id, get_the_title( $post_id ) ) );
WP_CLI::line( sprintf( "-- pushing to %s sites and deleting from %s sites", number_format( count( $sites['selected_sites'] ) ), number_format( count( $sites['removed_sites'] ) ) ) );
Expand All @@ -151,8 +151,7 @@ private function _make_em_talk_push() {
}

private function _get_syndication_server() {
global $push_syndication_server;
return $push_syndication_server;
return $GLOBALS['push_syndication_server'];
}

protected function stop_the_insanity() {
Expand Down
2 changes: 1 addition & 1 deletion push-syndication.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
if ( defined( 'WP_CLI' ) && WP_CLI )
require_once( dirname( __FILE__ ) . '/includes/class-wp-cli.php' );

$push_syndication_server = new WP_Push_Syndication_Server;
$GLOBALS['push_syndication_server'] = new WP_Push_Syndication_Server;

// Create the event counter.
require __DIR__ . '/includes/class-syndication-event-counter.php';
Expand Down

0 comments on commit 374adf6

Please sign in to comment.