Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • My checkboxes are returning 1 always, no matter if they are checked or not.

    I just managed to do it by myself. Include this code in your theme’s functions.php

    add_filter('menu_icons_item_title', 'mytheme_menu_icons_item_title', 10, 4);
    function mytheme_menu_icons_item_title($title_with_icon, $id, $meta, $title) {
    	if (strrpos($meta['url'], '.svg') !== FALSE && strlen($meta['url']) - strrpos($meta['url'], '.svg') == 4) {
    		$svg = file_get_contents($meta['url']);
    		$svg = substr($svg, strpos($svg, '<svg ')); // remove file headers
    		$title_with_icon = $svg . substr($title_with_icon, strpos($title_with_icon, '<span'));
    	}
    	return $title_with_icon;
    }

    Hope it helps!

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