Plugin Directory

Embed GitHub Gist

Embed GitHub Gists into WordPress.

Download Version 0.8

Follow here: Embed GitHub Gist

Embed GitHub Gists into WordPress. Provides a shortcode for posts and pages but also has the ability to embed by hand in the event that a Gist needs to be embedded somewhere in the page that does not pass through the shortcode filters.

Examples:

[gist id=546764]
[gist id=546764 file=file.txt]
[gist id=546764 file=file.txt bump=1]
[gist]http://gist.github.com/546764[/gist]

Cache is implemented with the Transients API to minimize delay on loading content. Default TTL (time to live) is 86400 seconds or one day.

If json_decode is available, the HTML markup for the source code will be injected into the post inline. This will ensure that the code is available to spiders and feed readers.

If json_decode is not available, the standard GitHub Gist embed script (JavaScript) is included and the raw content will be added into a NOSCRIPT section wrapped as follows:

<noscript>
<div class="embed-github-gist-source">
<code>
<pre>raw code here</pre>
</code >
</div>
</noscript>

Upcoming features:

  • Option for setting default TTL
  • Option to bypass cache entirely
  • Option to select CSS loading location preference
  • Option to allow for preferring JavaScript over inline HTML
  • Shortcode attribute to control inline vs. js preference
  • Implement admin interface to control options
Author: dflydev

Requires: 2.8.6 or higher
Compatible up to: 3.1.4
Last Updated: 2011-5-9 Downloads: 1,442

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(3 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1 50,2,1
100,1,1
100,1,1
100,1,1