/** * Append AngelList content to post content * * @since 1.0 * @param string post content * @return string post content with AngelList content appended */ public function content($content) { global $post; if (!(in_the_loop() && isset($post) && $content && isset($this->company_ids) && is_array($this->company_ids))) { return $content; } $post_id = absint($post->ID); if ($post_id < 1) { return $content; } $cache_key = AngelList_Content::cache_key($post_id, is_ssl()); $angellist_content = get_transient($cache_key); if (empty($angellist_content)) { $angellist_content = AngelList_Content::generate_content($this->company_ids); // store markup for one hour. // speeds up page generation, takes heat off the AngelList API server if ($angellist_content) { set_transient($cache_key, $angellist_content, 3600); } } unset($cache_key); // add a newline to separate new content from the last line of a post // avoids possible errors with oEmbed or other single-line detected content on the last line when priority < 10 if ($angellist_content) { return $content . "\n" . $angellist_content; } return $content; }