mpp_register_gallery_view( $type, $view )
Register a gallery view for the given type.
Description
This function is used to register new gallery view for given type. Admin can choose to use this view from the settings page for each component.
Parameters
$type (String) (Required):- The unique identifier for the media type we registered via mpp_register_type
$view (MPP_Gallery_View) (Required):- An object of MPP_Gallery_View type. You must extend this class to provide a concrete implementation.
Returns
Boolean. True on success, false on failure.
Examples
The code shows how we register the default gallery view(grid view) for photos.
1 2 3 4 5 6 7 8 | function mpp_custom_register_default_gallery_view() { $view = MPP_Gallery_View_Default::get_instance(); mpp_register_gallery_view( 'photo', $view ); } add_action( 'mpp_setup', 'mpp_custom_register_default_gallery_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