wp_schedule_event seems to be being added twice

It looks like you know what’s going on – here’s a way to avoid running the activation method more than once: class AdminSupport { protected static $activated = false; public function onInitialize(){ add_action(‘my_hourly_event’, array($this, ‘do_this_hourly’ )); } public function my_activation() { if ( self::$activated ) { return; } wp_schedule_event( time(), ‘hourly’, ‘my_hourly_event’ ); self::$activated = … Read more

Caching the_content calls

The first implementation is in a new function called the_content_cached. function the_content_cached( $more_link_text = null, $strip_teaser = false ) { $post_id = get_the_ID(); // Not possible to tie content to post ID if ( ! $post_id ) { the_content( $more_link_text, $strip_teaser ); return; } $cached = wp_cache_get( $post_id, ‘the_content’ ); // Cache miss if ( … Read more