• Resolved Andrew

    (@sm60)


    The Responsive Lightbox plugin has a conflict with another plugin I use. I have the fix for it – I just need to enable ‘custom events’. But I use a multisite so I need to force this option to always be set to enable. Otherwise each user will have to enable custom events themselves so it works correctly. I managed to achieve this by editing the plugin where it says:

    <input id="rl-enable-custom-events-' . $val . '" type="radio" name="responsive_lightbox_settings[enable_custom_events]" value="' . $val . '" ' . checked(($val === 'yes' ? TRUE : FALSE), $this->options['settings']['enable_custom_events'], FALSE) . ' /><label for="rl-enable-custom-events-' . $val . '">' . esc_html($trans) . '</label>';

    I only had to change:
    TRUE : FALSE
    to:
    FALSE : TRUE
    This sets custom events to enable and prevents a user from switching it to disable. But I was wondering if it is possible to code it in one of my files instead? I use a must-use plugin file where I put php snippets in. Otherwise I’ll have to keep editing the plugin every time the plugin is upgraded.

    Any help appreciated.

    https://ww.wp.xz.cn/plugins/responsive-lightbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dFactory

    (@dfactory)

    That’s what rl_lightbox_args filter is for.

    You can use it to force that setting like that:

    function custom_rl_lightbox_args($args) {
    	$args['custom_events'] = ' ajaxComplete'; // or any other custom events you wish to force
    	return $args;
    }
    add_filter('rl_lightbox_args', 'custom_rl_lightbox_args');
    Thread Starter Andrew

    (@sm60)

    Brilliant, thanks, I’ll try it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Enabling Custom events’ is closed to new replies.