20 add_filter(
'gravityview_lightbox_script', array( $this,
'filter_lightbox_script' ), 1000 );
21 add_filter(
'gravityview_lightbox_style', array( $this,
'filter_lightbox_style' ), 1000 );
23 add_filter(
'gravityview/fields/fileupload/link_atts', array( $this,
'fileupload_link_atts' ), 10, 4 );
24 add_filter(
'gravityview/get_link/allowed_atts', array( $this,
'allowed_atts' ) );
26 add_action(
'wp_enqueue_scripts', array( $this,
'enqueue_scripts') );
27 add_action(
'wp_enqueue_scripts', array( $this,
'enqueue_styles') );
29 add_action(
'gravityview/template/after', array( $this,
'print_scripts' ) );
31 add_action(
'wp_footer', array( $this,
'output_footer' ) );
46 if ( ! self::is_active( $gravityview ) ) {
50 wp_print_scripts( static::$script_slug );
51 wp_print_styles( static::$script_slug );
63 protected static function is_active( $gravityview ) {
65 $lightbox = $gravityview->view->settings->get(
'lightbox' );
73 if ( static::$slug !== $provider ) {
89 remove_filter(
'gravityview_lightbox_script', array( $this,
'filter_lightbox_script' ), 1000 );
90 remove_filter(
'gravityview_lightbox_style', array( $this,
'filter_lightbox_style' ), 1000 );
92 remove_filter(
'gravityview/fields/fileupload/link_atts', array( $this,
'fileupload_link_atts' ), 10 );
93 remove_filter(
'gravityview/get_link/allowed_atts', array( $this,
'allowed_atts' ) );
95 remove_action(
'wp_enqueue_scripts', array( $this,
'enqueue_scripts') );
96 remove_action(
'wp_enqueue_scripts', array( $this,
'enqueue_styles') );
98 remove_action(
'wp_footer', array( $this,
'output_footer' ) );
109 return static::$script_slug;
120 return static::$style_slug;
142 return apply_filters(
'gravityview/lightbox/provider/' . static::$slug .
'/settings',
$settings );
print_scripts( $gravityview)
Prints scripts for lightbox after a View is rendered.
add_hooks()
Adds actions and that modify GravityView to use this lightbox provider.
allowed_atts( $atts=array())
Modify the attributes allowed in an anchor tag generated by GravityView.
output_footer()
Output raw HTML in the wp_footer()
get_settings()
Get the settings for the JavaScript, with filter applied.
remove_hooks()
Removes actions that were added by {.
default_settings()
Get default settings for the script.
filter_lightbox_style( $style='thickbox')
Modifies the name of the stylesheet to be enqueued when loading thickbox.
enqueue_styles()
Enqueue styles for the lightbox.
Registers a lightbox provider.
filter_lightbox_script( $script='thickbox')
Modifies the name of the stylesheet to be enqueued when loading thickbox.
fileupload_link_atts( $link_atts, $field_compat=array(), $context=null, $additional_details=null)
Modified File Upload field links to use lightbox.
gravityview()
The main GravityView wrapper function.
enqueue_scripts()
Enqueue scripts for the lightbox.
static is_active( $gravityview)
Returns whether the provider is active for this View.