/** * Sets the media for the post. * * @return void * @access public * @since 1.0.0 */ public function set_media() { if (isset($this->args['meta_key'])) { $url = get_post_meta(get_the_ID(), $this->args['meta_key'], true); $this->media = do_shortcode("[{$this->type} src='{$url}']"); } parent::set_media(); }