Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Or even better, if you are also using widgets with the widgets classes plugin, change:

    var $img = jQuery(this);
    to

    var $img = jQuery(this).is('img') ? jQuery(this) : jQuery(this).find('img:first');
    if (!$img.length) { return }

    and set the plugin setting “CSS Class to target” to
    style-svg, figure.style-svg, section.style-svg

    This fixed it for me

    Change this in the plugin’s enqueue.php line 108

    $css_target_array = array(
    	'Bodhi' => $css_target,
    	'ForceInlineSVG' => 'false'
    );

    Comment out the following line
    wp_localize_script( 'bodhi_svg_inline', 'ForceInlineSVGActive', $force_inline_svg_active );

    In svg-inline.js replace first occurrences of

    ForceInlineSVGActive === 'true'
    with
    cssTarget.ForceInlineSVG && cssTarget.ForceInlineSVG !== 'false'

    and replace

    if ( ForceInlineSVGActive === 'true' ) {
        var target  = ( cssTarget.Bodhi !== 'img.' ? cssTarget.Bodhi : 'img.style-svg' );
    } else {
        var target  = ( cssTarget !== 'img.' ? cssTarget : 'img.style-svg' );
    }

    with

    var target = ( cssTarget.Bodhi !== 'img.' ? cssTarget.Bodhi : 'img.style-svg' );

    If you are using WP blocks with svg images I recommend also changing the following

    var $img = jQuery(this);

    to

    var $img = jQuery(this).is('figure') ? jQuery(this).find('img:first') : jQuery(this);

    and setting “CSS Class to target” in the plugin with style-svg, figure.style-svg

    Next be sure to set “Use Expanded JS?” to “Yes” in the plugin settings

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