WP Github Gist plugin now supports the new Gist API

Like my Twitter Avatar plugin, even my WP Github Gist plugin was broken recently due to changes in the underlying API that my plugin was using. This time it was because of the changes in the Gist Embed API.

Adding user to the gist embed url

In the earlier version of the gist embed API, the url to the embed script had only the id of the gist. But in the new version the user name is also added.

So I have added a new attribute called user to the gist shortcode where you can specify the user name.

Handling old Gist shortcodes

Unfortunately the above change breaks old gist shortcodes that you might already have in your posts where the user name is not specified. I have introduced a filter called wp-github-gist-user using which you can specify the user name for old gists. This will be helpful if you have embedded gist from the same user in all your old posts. If you have embeded gists from multiple users then I am sorry, you may have to go and manually add the user to all of them.

You can checkout the sample plugin that I have created that explains how you can override the user name using this filter. Essentially you have to just add the following code to your functions.php file or create a separate plugin like I did.


This is a mandatory update. You can download the latest version of the Plugin from the Plugin’s homepage or install it using the Plugin installer.


Please keep the feedback coming and if you want me to add any new features or find a bug, please leave a comment or post about it in twitter.

Related posts

Tags: , , , , ,

0 Comments so far

Follow up comments through RSS Feed | Post a comment

You are the first one to start the discussion.

Leave a Reply

Your email address will not be published. Required fields are marked *