Skip to content

Commit

Permalink
Removed underscores from wp-cron events hooks, as per the codex
Browse files Browse the repository at this point in the history
  • Loading branch information
nddery committed Jul 10, 2013
1 parent 94a3bb5 commit 1bb9eec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/social/controller/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function action_cron_15() {
Social::log('Attempting semaphore lock');
if ($semaphore->lock()) {
Social::log('Running social_cron_15_action.');
do_action('social_cron_15');
do_action('socialcron15');
$semaphore->unlock();
}
}
Expand All @@ -57,7 +57,7 @@ public function action_check_crons() {
Social::log('API key failed');
wp_die('Oops, invalid API key.');
}

$crons = _get_cron_array();
$social_crons = array(
'15' => false,
Expand Down
4 changes: 2 additions & 2 deletions lib/social/controller/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function action_index() {
Social::option('cron', $this->request->post('social_cron'));

// Unschedule the CRONs
if ($this->request->post('social_cron') != '1' and ($timestamp = wp_next_scheduled('social_cron_15_init')) !== false) {
wp_unschedule_event($timestamp, 'social_cron_15_init');
if ($this->request->post('social_cron') != '1' and ($timestamp = wp_next_scheduled('socialcron15init')) !== false) {
wp_unschedule_event($timestamp, 'socialcron15init');
}
}

Expand Down
12 changes: 6 additions & 6 deletions social.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ public function check_system_cron() {
Social::log('Checking system CRON');
// Schedule CRONs
if (Social::option('cron') == '1') {
if (wp_next_scheduled('social_cron_15_init') === false) {
if (wp_next_scheduled('socialcron15init') === false) {
Social::log('Adding Social 15 CRON schedule');
wp_schedule_event(time() + 900, 'every15min', 'social_cron_15_init');
wp_schedule_event(time() + 900, 'every15min', 'socialcron15init');
}
wp_remote_get(
admin_url('options_general.php?'.http_build_query(array(
Expand Down Expand Up @@ -1203,7 +1203,7 @@ public function cron_schedules($schedules) {
/**
* Sends a request to initialize CRON 15.
*
* @wp-action social_cron_15_init
* @wp-action socialcron15init
* @return void
*/
public function cron_15_init() {
Expand All @@ -1214,7 +1214,7 @@ public function cron_15_init() {
/**
* Runs the aggregation loop.
*
* @wp-action social_cron_15
* @wp-action socialcron15
* @return void
*/
public function run_aggregation() {
Expand Down Expand Up @@ -2319,9 +2319,9 @@ function social_get_shortlink($post_id) {
add_action('social_settings_save', array('Social_Service_Facebook', 'social_settings_save'));

// CRON Actions
add_action('social_cron_15_init', array($social, 'cron_15_init'));
add_action('socialcron15init', array($social, 'cron_15_init'));
if (Social::option('aggregate_comments')) {
add_action('social_cron_15', array($social, 'run_aggregation'));
add_action('socialcron15', array($social, 'run_aggregation'));
}

// Admin Actions
Expand Down

0 comments on commit 1bb9eec

Please sign in to comment.