Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1477759

    The new font-icon handling leads to one question about replacing standard icons.
    The old method works if we want to replace font-icons by different font-icons:

    function avia_replace_default_icons($icons){
    	$icons['standard'] =  array( 'font' =>'custom-font', 'icon' => 'ue807');
    		return $icons;
    	}
    add_filter('avf_default_icons','avia_replace_default_icons', 10, 1);

    now we got that SVG Iconset: Wp Media Library (svg_wp-media-library)
    how to replace the standard icon by a media library svg ?

    Edit i tested it with the icon name – but that does not work.
    we now have to use the svg ID to replace:

    function avia_replace_default_icons($icons){
    	$icons['svg__standard'] =  array( 'font' =>'svg_wp-media-library', 'icon' => '40720');
    		return $icons;
    	}
    add_filter('avf_default_icons','avia_replace_default_icons', 10, 1);
    #1477763

    Hey Guenter,

    wp-media-library svg are identified by attachment ID (which is unique) – title of svg which is used as name can be changed which would lead to loosing the icon. If you check the shortcode of e.g. ALB icon you will see that the ID is also used.

    For other svg iconsets you must use the name – as it is the name of the svg file it will never change.

    Best regards,
    Günter

    #1477767

    Thanks to clarify the usage.

    #1488888

    allthough i set the right font and ID it does not show the right name and does not show the social icon

    So how to have new social icons via media library?

    function avia_add_custom_icons($icons){
      $icons['bluesky'] =  array( 'font' =>'svg_wp-media-library', 'icon' => '1787', 'display_name' => 'Bluesky SVG');
        return $icons;
      }
    add_filter('avf_default_icons','avia_add_custom_icons', 10, 1);

    Edit: now i see your comment with the name that $icons[‘bluesky’] inside the bracket has to be the file name of the icon!
    And: and my mistaken – the display_name is only for the hover style – and not for that drop-down list in Soziales Symbol list.

    ________

    Next: On the ALB Element Share Buttons – if we do not want the standard ( set on Options: Blog Layout ) but to set it manually in the ALB (Use a custom set). The new icon is not in there.

    function avia_add_social_share_link_arguments($args){
        $bluesky = array('bluesky' => array("encode" => true, "encode_urls" => false, "pattern" => "https://www.bluesky.com/", 'label' => __("Share on bluesky", 'avia_framework')));
        $args = array_merge($bluesky, $args);  
        return $args;
    }
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);

    so maybe a similar (or the same ) filter inside social_share.php would be nice to have. And inserting the above will do the job twice

    • This reply was modified 1 day, 11 hours ago by Guenni007.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.