• Resolved bfsc

    (@bfsc)


    I’m trying to add a custom social media icon but it is not working.

    The graduation-cap icon is available in the free font-awesome icons (https://fontawesome.com/icons?d=listing&m=free)

    Following goes the code I’m using:

    add_filter( 'wpcw_widget_social_custom_fields', function ( $fields, $instance ) {
    
      $fields['lattes'] = [
        'icon'      => 'graduation-cap', // See font-awesome icon slug
        'label'     => __( 'Lattes', 'YOURTEXTDOMAIN' ),
        'default'   => 'https://lattes.cnpq.br/username',
        'select'    => 'username',
        'sanitizer' => 'esc_url_raw',
        'escaper'   => 'esc_url',
        'social'    => true,
        'target'    => '_blank',
      ];
    
      return $fields;
    
    }, 10, 2 );
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter bfsc

    (@bfsc)

    the theme I’m using is Simpleasy

    Plugin Author Evan Herman

    (@eherman24)

    Hi @bfsc,

    The first thing I would recommend is adding a 'prefix' => 'fas' for the font awesome solid font family. That should make the icon visible. I did just test, and it looks like there is a small bug preventing the custom icon from rendering in the widget. More specifically, we need to filter the icons in one other location so that things work out as intended.

    I will work on a patch and hopefully get this pushed out in the coming days.

    Plugin Author Evan Herman

    (@eherman24)

    If you are at all curious about the fix, I’ve got a pull request up on Github that we’ll have to merge in when we roll out the 1.5.1 release.

    https://github.com/godaddy/wp-contact-widgets/pull/53

    Thread Starter bfsc

    (@bfsc)

    Hi @eherman24,

    Thank you for your fast reply.

    I should had been more specific. I’m actually facing two problems.

    1. Icon is not visible (I’ll wait for your patch to be integrated)
    2. The text field to enter the profile url is also not visible for custom social media

    Regarding the item 2, when I click on the icon of a custom social media (some icons are working, e.g. google) the text field to fill with my social media profile does not appear. So, I cannot enter my profile url, as I can with the native social medias like facebbok, twitter, etc.

    Thank you again!

    Plugin Author Evan Herman

    (@eherman24)

    Hi @bfsc,

    If you add 'prefix' => 'fas' to the lattes array the icon still is not visible? You may want to try clearing your browser cache. In my testing just adding that prefix made the icon visible. The patch I have listed above does resolve issue #2 you have outlined above. I’ll do some retesting and confirm both issues are fixed before merging in the PR.

    Evan

    Thread Starter bfsc

    (@bfsc)

    Hi @eherman24,

    The icon still does not appear. Following is the code I’m using:

    add_filter( 'wpcw_widget_social_custom_fields', function ( $fields, $instance ) {
    
      $fields['lattes'] = [
        'icon'      => 'fa-graduation-cap', // See font-awesome icon slug
        'label'     => __( 'Lattes', 'YOURTEXTDOMAIN' ),
        'default'   => 'https://lattes.cnpq.br/username',
        'select'    => 'username',
        'sanitizer' => 'esc_url_raw',
        'escaper'   => 'esc_url',
        'social'    => true,
        'target'    => '_blank',
    	'prefix' 	=> 'fas',
      ];
    
      return $fields;
    
    }, 10, 2 );
    • This reply was modified 6 years, 9 months ago by bfsc.
    Thread Starter bfsc

    (@bfsc)

    Hi @eherman24,

    Have you reproduced the issue #2? Or it is just occuring with me?

    Regarding my code snippet on the post above, is anything wrong?

    Thank you!

    Plugin Author Evan Herman

    (@eherman24)

    @bfsc, Your code snippet looks correct – I don’t see anything wrong. I believe the issue will be resolved with my pull request mentioned above. I will have to do some testing to confirm and get things merged in and released.

    We are currently investigating other reported conflicts with some themes and other plugins.

    Plugin Author Evan Herman

    (@eherman24)

    Hi @bfsc,

    We went ahead and rolled out v1.5.1 which should fix this issue. Go ahead and update, and if you are still encountering issues, feel free to post back here.

    Thanks for reporting the issue here. Have a great rest of your week!

    Evan

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom Social Media Icon’ is closed to new replies.