Title: wdevraz's Replies | WordPress.org

---

# wdevraz

  [  ](https://wordpress.org/support/users/wdevraz/)

 *   [Profile](https://wordpress.org/support/users/wdevraz/)
 *   [Topics Started](https://wordpress.org/support/users/wdevraz/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wdevraz/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wdevraz/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wdevraz/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wdevraz/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wdevraz/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP OAuth Server (OAuth Authentication)] How to get the user info?](https://wordpress.org/support/topic/how-to-get-the-user-info/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/how-to-get-the-user-info/#post-8556388)
 * Hi,
 * I’m having trouble finding a way to retrieve the data from the link you posted.
 * It works fine when I pass the access_token through to the URL as you said, and
   it displays all the current user info in an array.
 * But is there a way to retrieve this array/data into the .php I posted above?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP OAuth Server (OAuth Authentication)] How to get the user info?](https://wordpress.org/support/topic/how-to-get-the-user-info/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/how-to-get-the-user-info/#post-8553135)
 * Thanks for the info! Much appreciated
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP OAuth Server (OAuth Authentication)] How to get the user info?](https://wordpress.org/support/topic/how-to-get-the-user-info/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/how-to-get-the-user-info/#post-8552888)
 *     ```
       Array
       (
           [result] => Array
               (
                   [access_token] => uy8zq1n67kb1bm9ycl5foflbi1vz2einq6cmbjqx
                   [expires_in] => 86400
                   [token_type] => Bearer
                   [scope] => basic
                   [refresh_token] => ld5yl7gmpf1bla2wn1rxnd7xkwpjqtdsnbvidupc
               )
   
           [code] => 200
           [content_type] => application/json
       )
       ```
   
 * Is there any way to retrieve username from this response?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699460)
 * I’m currently working on a small fix for counting the shares on your plugin, 
   which will search for HTTP as well as HTTPS, as the website I linked used to 
   be using HTTP, so now some of the shares aren’t showing as it is only searching
   for HTTPS through the API’s. If possible I could send you the code and you could
   implement it in a new version of the plugin? Might help some people 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699455)
 * Okay that was really easy, and I’m not great with JavaScript either!
 * Here’s my code, with a brief explanation in comments for anyone who wants to 
   use this.
 *     ```
       (function($) {
       $("#crestashareicon").prependTo(".share-article-vertical"); //here is where we move the floating bar, change '.share-article-vertical' with where you want to move it.
   
       fshares = $("#facebook-count").text(); //get facebook shares
       gshares = $("#googleplus-count").text(); //get gplus shares
       pshares = $("#pinterest-count").text(); //get twitter shares
       totalshares = fshares + gshares + pshares; //add all shares
   
       $( "#total-count" ).replaceWith( totalshares ); //replace the spinning loading icon with the total shares
       })(jQuery);
   
       Don't forget to turn off <code>fixed</code> positioning for the <code>#crestashareicon</code> element in CSS!
       ```
   
 * Done! Thanks for the great plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699451)
 * Classic mode style it is still broken.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699450)
 * Ok I have thought of a solution.
 * I can use JavaScript to get the values inside of `#facebook-count`, `#twitter-
   count` elements, which contain the amount of shares for each social network.
 * Then I will use JavaScript to add these together and replace the animated loading
   icon with the total number.
 * I’ll let you know how I get on and post my full solution in-case others would
   like to use it. This is of course only a hack/work-around for now 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699448)
 * Hi,
 * I just reinstalled your plugin to revert all the changes I made in the code. 
   Now instead I am simply using some jQuery to re-position the floating bar and
   place it inside of the container next to the article, code is below.
 * `$("#crestashareicon").appendTo(".share-article-vertical");`
 * However the total shares are still broken
 * So even without modifying the PHP or JS in your plugin but just by simply moving
   it, it breaks the total shares.
 * Not sure what to do…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699444)
 * Hi,
 * Thanks for the speedy response. The website is over at [https://sciscomedia.co.uk/proxima-b-habitable-planet/](https://sciscomedia.co.uk/proxima-b-habitable-planet/)(
   that is one of the articles)
 * You can see the social bar on the side, I have done `display:none` on #total-
   shares in CSS so if you inspect element you can remove that and see the problem
   with spinning loading icon 🙂
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cresta Social Share Counter] Add floating bar into PHP with function/shortcode?](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/)
 *  Thread Starter [wdevraz](https://wordpress.org/support/users/wdevraz/)
 * (@wdevraz)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/add-floating-bar-into-php-with-functionshortcode/#post-7699366)
 * Okay so I found out how to place it there. Everything is working APART from the
   total amount of shares.
 * I found `add_action('wp_footer', 'add_social_button');` inside `cresta-social-
   share-counter.php` (around line **464**) – this creates the floating social bar.
 * I replaced `wp_footer` with the name of the function that displays the theme’s
   own social bar, so it looked like: `add_action('thb_social_article_detail_vertical','
   add_social_button');`
 * Inside my themes files, I went to that function (`thb_social_article_detail_vertical`)
   and removed all the `echo`‘s where it was trying to display its own share bar.
   Now `cresta-social-share-counter.php` is basically going to inject the plugin’s
   share bar into there.
 * Voila, it works! But now the total number of shares won’t work, it just shows
   a loading icon for infinite time. Obviously something to do with the way it’s
   called through `wp_footer`, but why? 🙁
 * Any help appreciated!

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