[Hustle] Custom icons for Social Share

0

I would like to see inside the plugin, an option to add custom social icons, to the Social Share feature. For example the Tripadvisor link. Please consider adding this.

  • Danae
    • Dev

    Hey Cefnllys Ltd ,

    We have this tasked in our backlog. It hasn’t being queued for development yet but we’re keeping an eye on this and listening to more requests for it. Having more requests means a feature getting a higher priority over other ones.

    Keeping you posted here :ok_hand:

  • Danae
    • Dev

    The status of the task is the same as in my last update I’m afraid, @mail382. Since that task could take a while until it’s released, I’ve created another one to allow this functionality via hooks in an earlier release. I’ve queued it, and will update you once we’ve checked it’s feasible and the release version is confirmed.

  • Danae
    • Dev

    Hi there Cefnllys Ltd ,

    This has been released. Now it’s possible to add custom social sharing networks via hooks, allowing you to give them a custom URL, with no functional counter at the moment.

    The filter name is “hustle_social_sharing_get_selected_networks”, which filters the networks that are shown in frontend. You must add a new key-value pair to the array. The network’s slug should be the key, and the value should be an associative array with the following data:
    – platform: string. Network’s slug. No spaces nor special chars.
    – label: string. Network’s display name.
    – type: string. Should be set to ‘click’ since the counter won’t retrieve the values from an API.
    – link: string. The URL to which the user will be taken when cliking on the icon.
    – counter: integer. Static number to be shown if counters are enabled. Not functional for now.

    The icon and the styling specific to the icon should be added via custom CSS.

    I’d recommend reaching out to our support if you have any issues setting this up. We’ll be glad to help.
    We’ll discuss introducing a friendlier way for doing this in the future. Hope this helps in the meantime.

    Wish you a nice day!

  • Patrick Freitas
    • FLS

    Hi Kangseok

    I hope you are doing well.

    You can use this as an example:

    <?php
    
    add_filter( 'hustle_social_sharing_get_selected_networks', function( $social_icons ){
    
      $social_icons[ ] = [
        'platform'  => 'tripadvisor-social',
        'label'     => 'Tripadvisor',
        'type'      => 'click',
        'link'      => 'https://www.tripadvisor.com/',
        'counter'   => 0
      ];
    
      return $social_icons;
    });

    The social icon needs to be handled using CSS,

    i.hustle-icon-social-0:before{
       // Your custom icon CSS
    }

    For example:

    i.hustle-icon-social-0:before{
     content: '';
      background-color: red;
      background-image: url('https://www.iconfinder.com/data/icons/logos-and-brands/512/340_Tripadvisor_logo-512.png');
      background-size: contain;
      width: 30px;
      height: 30px;
    }

    [attachments are only viewable by logged-in members]

    In case you need any further help, kindly create a new ticket and we can take a closer look.

    Best Regards
    Patrick Freitas