/** * To Generate the actual code for showing media * We will rewrite it with better api in future, currently, It acts as fallback * * The goal of this function is to generate appropriate output for listing media based on media type * * @param type $media */ function mpp_load_media_view($media = null) { $view = mpp_get_media_view($media); if (!$view) { printf(__('There are no view object registered to handle the display of the content of <strong> %s </strong> type', 'mediapress'), $media->type); } else { $view->display($media); } }
function mpp_get_media_content($media = null) { $media = mpp_get_media($media); $view = mpp_get_media_view($media->type, mpp_get_storage_manager($media->id)); if (!empty($view)) { return $view->get_html($media); } return sprintf(__('There are no view object registered to handle the display of the content of <strong> %s </strong> type', 'mediapress'), $media->type); }