Set media metadata (i.e. “dimensions” field) on SVG file after extracting it with a filter

The wp_update_attachment_metadata filter fires every time you upload an image through media library (specifically every time wp_update_attachment_metadata function is being called). So when an svg file is uploaded we check if the file has the desired metadata, the width and height. If not, we generate the metadata as you did in your wp_get_attachment_image_src filter. Now … Read more

How to implement my own icons instead of using the svg icon system

You could replace the function that is getting the svg image like so: <nav class=”social-navigation” role=”navigation” aria-label=”<?php esc_attr_e( ‘Footer Social Links Menu’, ‘twentyseventeen’ ); ?>”> <?php wp_nav_menu( array( ‘theme_location’ => ‘social’, ‘menu_class’ => ‘social-links-menu’, ‘depth’ => 1, ‘link_before’ => ‘<span class=”screen-reader-text”>’, ‘link_after’ => ‘</span><img src=”‘.get_home_url().’/path/to/image.png”>’, ) ); ?> </nav><!– .social-navigation –>

SVG image upload stopped working

By default, WP does not allow SVG uploads, and you should get that error. Preventing SVG uploads is a security feature (which I explain below). I can’t help you debug your function, because that is beyond my expertise, but I can suggest a work around. You can use a plugin like SafeSVG (https://wordpress.org/plugins/safe-svg/) to enable … Read more

use of tag into wordpress

I think that WordPress currently not allow the svg tag in his editor. But you can change this, see this answer for more hints, background. I think the follow small source should help you to allow this tag and his attribute. Copy in a plugin (add a plugin header) and activate. But I think, that … Read more

Stylizing external SVG files with jQuery and CSS

Sorry to say, but it’s not possible, because none of the elements from the SVG are read in the DOM, so CSS and Javascript don’t see them. All it sees is the <img> block, none of its contents. You have to import your SVGs into the page to have them be able to be manipulated. … Read more

Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons

Ok, this is what I did: First, I replicated classes/class-twentynineteen-svg-icons.php to the child theme. Renamed to class-mytheme-svg-icons.php. Added a extend with my New_SVG_Icons class: class New_SVG_Icons extends TwentyNineteen_SVG_Icons { /** * Gets the SVG code for a given icon. */ public static function get_svg( $group, $icon, $size ) { if ( ‘ui’ == $group ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)