WordPress.org

Ready to get started?Download WordPress

Forums

Social
Cron not running - a solution (2 posts)

  1. nddery
    Member
    Posted 1 year ago #

    We've been having some problems lately with Twitter Tools and Social plugins. Twitter Tools relies on Social social_cron_15 hook to update the twitter messages. However, according to the codex, "For some reason there seems to be a problem on some systems where the hook must not contain underscores or uppercase characters." (wp_schedule_event).

    We've since then added this function to our functions.php file and it solved the problem - notice the hook, no underscore.

    function uf_run_twitter_tools_cron() {
      if (Social::option('cron') == '1') :
        if (wp_next_scheduled('ufcronevery15') === false) :
          wp_schedule_event(time() + 900, 'every15min', 'ufcronevery15');
        endif;
      endif;
    }
    if ( is_admin() )
      add_action( 'wp_loaded', 'uf_run_twitter_tools_cron', 1 );
    
    add_action( 'ufcronevery15', array( 'AKTT', 'import_tweets' ) );

    http://wordpress.org/extend/plugins/social/

  2. nddery
    Member
    Posted 1 year ago #

    Oh and one more thing, using the WP-Cron plugin, we've noticed that the every15min cron recurrence was not listed as available. We've added it manually as it was simpler but if the above the does work on it's own, you might have to do this too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic