mpp_register_media_view( $type, $storage, $view )
Register a new media view. Media views represent single media item.
Description
This function is used to register new views for single media item.
Parameters
$type (String) (Required) :- Unique identifier for the media type
$storage (String) (Required) :- Unique identifier for the storage manager. Media Views are dependent on their storage(e.g remote media vs local media). You should use “default” or “local” for now.
$view (MPP_Media_View) (Required) :- An object of MPP_Media_View class. All concrete media view must extend MPP_Media_View class.
Returns
Boolean. True on success, false on failure.
Examples
The example shows how we register a default video view
1 2 3 4 5 6 7 | function mpp_custom_deregister_video_default_view() { mpp_register_media_view( 'audio', 'default', new MPP_Media_View_Video() ); } add_action( 'mpp_setup', 'mpp_custom_deregister_video_default_view', 11 ); |
Note:-
It must be used on or after “mpp_setup_core” action.
See also:-
Changelog
- Since 1.0.0
Source
medisapress/core/api/mpp-api.php