WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] [Plugin: AddThis] Using tw:hashtags with the WordPress Plugin (8 posts)

  1. RockoRobotics
    Member
    Posted 1 year ago #

    From within the AddThis settings in the WordPress Admin area, I am trying to build a custom AddThis Twitter Button. My goal is to use something like this:

    <a class="addthis_button_tweet" tw:hashtags="#hashtags"></a>

    However, when I save the settings, the tw:hastags portion of the button is removed. The rest of the of the code remians. Other attributes, such as tw:text work as expected. Is there something simple that I am just missing?

    http://wordpress.org/extend/plugins/addthis/

  2. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @RockoRobotics: Let me have a look. What's the WP version & AddThis plugin you are having? If possible, share the string you are trying to save in settings.

  3. RockoRobotics
    Member
    Posted 1 year ago #

    The WordPress Version is 3.4.1 and I have tried this with the past few versions of the plugin, including the latest version 2.5.0.

    I cannot give the exact string I am trying to save because of client confidentiality reasons.(I work for a web design company and it is part of how the company operates). However, I have tried a variety of different text strings inside the tw:hashtags and it is always removed.

    I have tried using this plugin on a blog with a different theme and only one other simple custom plugin active and the issue still persists. Perhaps you can give me an example of a tweet button that you know works and I can work from that.

  4. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @RockoRobotics : You are right. Let me try for an easy fix for this. Thanks for pointing it out.

  5. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @RockoRobotics: Try this one.

    In addthis_settings_functions.php, around line #33 you can see the following lines :-

    $mytags['a'][ 'twurl' ]= array();
    $mytags['a'][ 'twvia' ]= array();
    $mytags['a'][ 'twtext' ]= array();

    Just add the line below it :-

    $mytags['a'][ 'twhashtags' ]= array();

    And in the wordpress settings text area for custom tags you just need to input

    <a class="addthis_button_tweet" tw:via="srijithv" tw:hashtags="foo,bar"></a>

    Please note that # is NOT to be prefixed for "foo", "bar" etc in the input tag, it will be added automatically.

    If you are not confident enough in handling the code, please let me know. Thanks again for reporting this. I have added this fix to the upcoming release.

  6. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @RockoRobotics: My bad! It might not work as expected. I am checking it out here. Will update you as soon as possible.

  7. RockoRobotics
    Member
    Posted 1 year ago #

    I tried your fix and it appears that the issue has been resolved. Thank you for your help.

  8. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Wonderful! Some one here flipped a switch when I tried and made my test fail. Good that it works now.
    We will be releasing an update to the plugin in a day, and it will have the modified change to allow hashtags. Thanks for pointing it out!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic