22 require_once
gravityview()->plugin->dir(
'includes/extensions/lightbox/class-gravityview-lightbox-provider.php' );
23 require_once
gravityview()->plugin->dir(
'includes/extensions/lightbox/fancybox/class-gravityview-lightbox-provider-fancybox.php' );
25 add_action(
'plugins_loaded', array( $this,
'set_provider' ), 11 );
27 add_action(
'gravityview/lightbox/provider', array( $this,
'set_provider' ) );
44 if ( empty( $provider ) ) {
45 $provider =
gravityview()->plugin->settings->get(
'lightbox', self::DEFAULT_PROVIDER );
48 if ( empty( self::$providers[ $provider ] ) || ! class_exists( self::$providers[ $provider ] ) ) {
49 gravityview()->log->error(
'Lightbox provider {provider} not registered.', array(
'provider' => $provider ) );
54 if ( self::$active_provider && self::$active_provider instanceof self::$providers[ $provider ] ) {
59 if( self::$active_provider ) {
60 self::$active_provider->remove_hooks();
63 self::$active_provider =
new self::$providers[ $provider ];
65 self::$active_provider->add_hooks();
73 public static function register( $provider ) {
74 self::$providers[ $provider::$slug ] = $provider;
set_provider( $provider=null)
Activate the lightbox provider chosen in settings.
__construct()
GravityView_Lightbox_Provider constructor.
Manage lightbox scripts for GravityView.
gravityview()
The main GravityView wrapper function.