From 31417aa0e3550153856ec0d028a0a8ab4a949154 Mon Sep 17 00:00:00 2001 From: Prasath Nadarajah <n.prasath.002@gmail.com> Date: Thu, 30 Aug 2012 15:35:30 +0530 Subject: [PATCH] checking wpcom file exist --- includes/class-wp-push-syndication-server.php | 3 ++- push-syndication.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/class-wp-push-syndication-server.php b/includes/class-wp-push-syndication-server.php index 6202922..6d51254 100644 --- a/includes/class-wp-push-syndication-server.php +++ b/includes/class-wp-push-syndication-server.php @@ -1091,7 +1091,8 @@ class WP_Push_Syndication_Server { if( $delete_pushed_posts != 'on' ) return; - // @TODO add cap check + if( !$this->current_user_can_syndicate() ) + return; wp_schedule_single_event( time() - 1, diff --git a/push-syndication.php b/push-syndication.php index b69042e..ecf1a2c 100644 --- a/push-syndication.php +++ b/push-syndication.php @@ -13,7 +13,8 @@ License: GPLv2 or later **************************************************************************/ require_once ( dirname( __FILE__ ) . '/includes/class-wp-push-syndication-server.php' ); -require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ); +if( file_exists( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ) ); + require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ); if ( !defined( 'PUSH_SYNDICATION_ENVIRONMENT' ) ) define( 'PUSH_SYNDICATION_ENVIRONMENT', 'WP' ); -- GitLab