/** * @return TWL_API_Post */ public static function getInstance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
/** * Get a list of images attached to a post * (Attached using the 'Attach Images to post' plugin) * * @param int $post_id The ID of the post for which you want to get attached images * @param string $size Size of the image shown for an image attachment (either of thumbnail, medium, large or full) * @return array Returns an array (of objects) of the images attached to a post. Returns an empty array if no images were found. * Each object has properties [id, url, width, height, orientation, is_original]; */ function twp_get_post_images($post_id = 0, $size = 'thumbnail') { if (!$post_id) { return array(); } return TWL_API_Post::getInstance()->getPostImages($post_id, $size); }