Changeset 854439
- Timestamp:
- 02/09/2014 10:58:44 PM (12 years ago)
- Location:
- laravel-paste-embed/tags/1.4
- Files:
-
- 3 edited
- 1 copied
-
. (copied) (copied from laravel-paste-embed/trunk)
-
README.md (modified) (1 diff)
-
laravel-paste-embed.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
laravel-paste-embed/tags/1.4/README.md
r825215 r854439 18 18 ```[lpe paste='cJ9']``` 19 19 20 21 ### History 22 * 1.4 - Updated to work with [laravel.io/bin](laravel.io/bin) 23 * 1.3 - Bug Fixes / Refractoring 24 * 1.0 - Initial Release 25 20 26 ### Thanks 21 27 I have shamelessly stolen the styling from the paste.laravel.com site itself. Many thanks to [Dayle Rees](https://twitter.com/daylerees). -
laravel-paste-embed/tags/1.4/laravel-paste-embed.php
r825729 r854439 2 2 /** 3 3 * @package LaravePasteEmbed 4 * @version 1. 2.14 * @version 1.4 5 5 */ 6 6 /* 7 7 Plugin Name: Laravel Paste Embed 8 Plugin URI: http://www.ryandurham.com/ 2013/04/06/laravel-paste-embed/9 Description: A plugin to embed pages & snippets from paste.laravel.cominto a wordpress site.8 Plugin URI: http://www.ryandurham.com/projects/laravel-paste-embed/ 9 Description: A plugin to embed pages & snippets from laravel.io/bin into a wordpress site. 10 10 Author: Ryan Durham 11 Version: 1. 312 Author URI: http:// rydurham.com11 Version: 1.4 12 Author URI: http://www.ryandurham.com/projects 13 13 License: GPL2 14 14 15 Thanks to Dayle Rees & co. for the styles: http://paste.laravel.com/css/style.css 15 Thanks to Dayle Rees & co. for the styles: http://paste.laravel.com/css/style.css (link no longer works) 16 16 17 17 Thanks to Taylor Dewey (@tddewey) for the advice! … … 50 50 51 51 //Pull data from paste.laravel.com 52 $url = esc_url("http:// paste.laravel.com/$paste");52 $url = esc_url("http://laravel.io/bin/$paste"); 53 53 $response = wp_remote_get($url); 54 54 $response_code = wp_remote_retrieve_response_code( $response ); … … 60 60 //Parse the body of the response to pull out the relevant content. 61 61 $dom = new DOMDocument(); 62 $html = $dom->loadHTML( wp_remote_retrieve_body( $response ) ); 63 $code = $dom->getElementsByTagName( 'code' )->item( 0 )->nodeValue; 62 libxml_use_internal_errors(true); 63 $html = @$dom->loadHTML( wp_remote_retrieve_body( $response ) ); 64 65 $code = $dom->getElementsByTagName( 'pre' )->item( 0 )->nodeValue; 64 66 65 67 //Capture the paste output in an object buffer. … … 69 71 echo "<div class=\"lpe_title\">$caption</div>"; 70 72 } 71 echo "<div class=\"lpe_link\"><a href=\"$url\" target=\"_blank\"> link</a> </div>";73 echo "<div class=\"lpe_link\"><a href=\"$url\" target=\"_blank\">bin/$paste</a> </div>"; 72 74 echo "<pre class=\"prettyprint linenums \" style=\"height: $height;\">"; 73 75 echo htmlentities($code); -
laravel-paste-embed/tags/1.4/readme.txt
r825729 r854439 1 1 === Laravel-Paste-Embed === 2 2 Contributors: rydurham 3 Donate link: http://www.ryandurham.com/ category/code/3 Donate link: http://www.ryandurham.com/projects 4 4 Tags: Laravel Paste 5 5 Requires at least: 3.3 6 Tested up to: 3. 67 Stable tag: 1. 36 Tested up to: 3.8 7 Stable tag: 1.4 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 A WordPress plugin for embedding text from paste.laravel.com.11 A WordPress plugin for embedding text from laravel.io/bin. 12 12 13 13 == Description == 14 14 15 A Wordpress plugin to embed code from paste.laravel.com.15 A Wordpress plugin to embed code from laravel.io/bin 16 16 17 17 == Installation == … … 19 19 1. Upload the `laravel-paste-embed` folder to the `/wp-content/plugins/` directory 20 20 2. Activate the plugin through the 'Plugins' menu in WordPress 21 3. Go to paste.laravel.comand create the paste you are going to embed in your page or post.22 4. Grab the identifying bit from the end of the URL. 'cJ9' in this case: http:// paste.laravel.com/cJ921 3. Go to laravel.io/bin and create the paste you are going to embed in your page or post. 22 4. Grab the identifying bit from the end of the URL. 'cJ9' in this case: http://laravel.io/bin/cJ9 23 23 5. In your page or post add this shortcode, with the relevant part of the URL in question: [lpe paste='cJ9'] 24 24
Note: See TracChangeset
for help on using the changeset viewer.