fbpx

SVG Problem after Theme Update

HomeTopicsSupport forumSVG Problem after Theme Update
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #16788
    Avatar
    Jean-Michel
    Participant

    Hello

    I made the theme update today. But now some SVG in the header are only displayed in black. Did that have an impact and if so how can I fix it.

    Caches have all been disabled.

    Example:
    https://www.jamb-allyouneed.ch/

    #16791
    Bogdan Donovan
    Bogdan Donovan
    Keymaster

    Hello,

    Please, provide us your admin access so we can log in and check this on your side.

    Thank you in advance.

    #16793
    Avatar
    Jean-Michel
    Participant

    is in Extra information
    Please do not switch on any other theme!

    #16798
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function xts_safe_style_css() {
    	return array();
    }
    
    add_filter( 'safe_style_css', 'xts_safe_style_css' );
    
    function xts_kses_allowed_html( $tags, $context ) {
    	switch ( $context ) {
    		case 'xts_notice':
    			$tags = array(
    				'a'      => array(
    					'href'     => true,
    					'rel'      => true,
    					'target'   => true,
    					'property' => true,
    				),
    				'strong' => array(),
    				'br'     => array(),
    			);
    			break;
    		case 'xts_table':
    			$tags = array(
    				'span' => array(
    					'style' => true,
    				),
    				'br'   => array(),
    			);
    			break;
    		case 'xts_breadcrumbs':
    			$tags = array(
    				'a'    => array(
    					'href'     => true,
    					'rel'      => true,
    					'target'   => true,
    					'property' => true,
    				),
    				'span' => array(
    					'class'  => true,
    					'typeof' => true,
    				),
    			);
    			break;
    		case 'xts_widget':
    			$tags = array(
    				'div'  => array(
    					'id'    => true,
    					'class' => true,
    				),
    				'span' => array(
    					'class' => true,
    				),
    				'p'    => array(
    					'class' => true,
    				),
    			);
    			break;
    		case 'xts_theme_settings':
    			$tags = array(
    				'a'      => array(
    					'href'     => true,
    					'class'    => true,
    					'rel'      => true,
    					'target'   => true,
    					'property' => true,
    				),
    				'p'      => array(
    					'class' => true,
    				),
    				'span'   => array(
    					'class' => true,
    				),
    				'div'    => array(
    					'id'    => true,
    					'class' => true,
    				),
    				'strong' => array(),
    				'br'     => array(),
    			);
    			break;
    		case 'xts_media':
    			$tags = array(
    				'iframe'  => array(
    					'align'           => true,
    					'src'             => true,
    					'height'          => true,
    					'width'           => true,
    					'title'           => true,
    					'class'           => true,
    					'allow'           => true,
    					'style'           => true,
    					'data-lazy-load'  => true,
    					'frameborder'     => true,
    					'allowfullscreen' => true,
    					'marginheight'    => true,
    					'marginwidth'     => true,
    					'hspace'          => true,
    					'name'            => true,
    					'scrolling'       => true,
    					'seamless'        => true,
    					'srcdoc'          => true,
    					'vspace'          => true,
    				),
    				'img'     => array(
    					'align'                   => true,
    					'alt'                     => true,
    					'border'                  => true,
    					'class'                   => true,
    					'data-xts-src'            => true,
    					'data-src'                => true,
    					'data-large_image'        => true,
    					'data-large_image_width'  => true,
    					'data-large_image_height' => true,
    					'data-srcset'             => true,
    					'data-caption'            => true,
    					'height'                  => true,
    					'hspace'                  => true,
    					'ismap'                   => true,
    					'longdesc'                => true,
    					'loading'                 => true,
    					'lowsrc'                  => true,
    					'src'                     => true,
    					'srcset'                  => true,
    					'sizes'                   => true,
    					'style'                   => true,
    					'title'                   => true,
    					'vspace'                  => true,
    					'width'                   => true,
    					'usemap'                  => true,
    				),
    				'i'       => array(
    					'class' => true,
    				),
    				'svg'     => array(
    					'width'       => true,
    					'xmlns'       => true,
    					'xmlns:xlink' => true,
    					'xmlns:serif' => true,
    					'xml:space'   => true,
    					'height'      => true,
    					'viewBox'     => true,
    					'fill'        => true,
    					'class'       => true,
    					'viewbox'     => true,
    					'style'       => true,
    					'aria-hidden' => true,
    					'role'        => true,
    					'version'     => true,
    					'focusable'   => true,
    					'id'          => true,
    				),
    				'path'    => array(
    					'fill'                => true,
    					'fill-rule'           => true,
    					'd'                   => true,
    					'transform'           => true,
    					'class'               => true,
    					'data-old_color'      => true,
    					'data-original'       => true,
    					'stroke'              => true,
    					'id'                  => true,
    					'tabindex'            => true,
    					'style'               => true,
    					'clip-path'           => true,
    					'clip-rule'           => true,
    					'color'               => true,
    					'color-interpolation' => true,
    					'color-rendering'     => true,
    					'cursor'              => true,
    					'display'             => true,
    					'fill-opacity'        => true,
    					'filter'              => true,
    					'mask'                => true,
    					'opacity'             => true,
    					'pointer-events'      => true,
    					'shape-rendering'     => true,
    					'stroke-dasharray'    => true,
    					'stroke-linecap'      => true,
    					'stroke-linejoin'     => true,
    					'stroke-miterlimit'   => true,
    					'stroke-opacity'      => true,
    					'stroke-width'        => true,
    					'vector-effect'       => true,
    					'visibility'          => true,
    				),
    				'polygon' => array(
    					'id'                  => true,
    					'tabindex'            => true,
    					'class'               => true,
    					'style'               => true,
    					'fill'                => true,
    					'fill-opacity'        => true,
    					'fill-rule'           => true,
    					'points'              => true,
    					'transform'           => true,
    					'focusable'           => true,
    					'clip-path'           => true,
    					'clip-rule'           => true,
    					'color'               => true,
    					'color-interpolation' => true,
    					'color-rendering'     => true,
    					'cursor'              => true,
    					'display'             => true,
    					'filter'              => true,
    					'mask'                => true,
    					'opacity'             => true,
    					'pointer-events'      => true,
    					'shape-rendering'     => true,
    					'stroke'              => true,
    					'stroke-dasharray'    => true,
    					'stroke-dashoffset'   => true,
    					'stroke-linecap'      => true,
    					'stroke-linejoin'     => true,
    					'stroke-miterlimit'   => true,
    					'stroke-opacity'      => true,
    					'stroke-width'        => true,
    					'vector-effect'       => true,
    					'visibility'          => true,
    				),
    				'circle'  => array(
    					'cx'           => true,
    					'cy'           => true,
    					'r'            => true,
    					'stroke'       => true,
    					'stroke-width' => true,
    					'fill'         => true,
    					'class'        => true,
    					'style'        => true,
    					'transform'    => true,
    				),
    				'g'       => array(
    					'id' => true,
    				),
    				'div'     => array(
    					'class' => true,
    					'style' => true,
    				),
    				'rect'    => array(
    					'x'      => true,
    					'y'      => true,
    					'width'  => true,
    					'height' => true,
    					'style'  => true,
    				),
    				'text'    => array(
    					'x'     => true,
    					'y'     => true,
    					'style' => true,
    				),
    			);
    			break;
    	}
    
    	return $tags;
    }
    
    add_filter( 'wp_kses_allowed_html', 'xts_kses_allowed_html', 10, 2 );

    Kind Regards

    #16799
    Avatar
    Jean-Michel
    Participant

    Wow extremely long code 🙂

    Is the problem with me, or with the theme?

    #16801
    Artem Temos
    Artem Temos
    Keymaster

    It is a bug in the theme. We are going to release an update very soon.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Sign in

No account yet?

Create an Account