/** * This loads the posts marked as containing Crayons */ public static function load_posts() { if (self::$crayon_posts === NULL) { // Load from db if (!(self::$crayon_posts = get_option(self::POSTS))) { // Posts don't exist! Scan for them. This will fill self::$crayon_posts self::$crayon_posts = CrayonWP::scan_posts(); update_option(self::POSTS, self::$crayon_posts); } } return self::$crayon_posts; }
public static function scan_and_save_posts() { self::save_posts(CrayonWP::scan_posts()); }