Plugin Directory

Changeset 854439


Ignore:
Timestamp:
02/09/2014 10:58:44 PM (12 years ago)
Author:
rydurham
Message:

Tagging version 1.4

Location:
laravel-paste-embed/tags/1.4
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • laravel-paste-embed/tags/1.4/README.md

    r825215 r854439  
    1818    ```[lpe paste='cJ9']```
    1919
     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
    2026### Thanks
    2127I 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  
    22/**
    33 * @package LaravePasteEmbed
    4  * @version 1.2.1
     4 * @version 1.4
    55 */
    66/*
    77Plugin 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.com into a wordpress site.
     8Plugin URI: http://www.ryandurham.com/projects/laravel-paste-embed/
     9Description: A plugin to embed pages & snippets from laravel.io/bin into a wordpress site.
    1010Author: Ryan Durham
    11 Version: 1.3
    12 Author URI: http://rydurham.com
     11Version: 1.4
     12Author URI: http://www.ryandurham.com/projects
    1313License: GPL2
    1414
    15 Thanks to Dayle Rees & co. for the styles: http://paste.laravel.com/css/style.css
     15Thanks to Dayle Rees & co. for the styles: http://paste.laravel.com/css/style.css  (link no longer works)
    1616
    1717Thanks to Taylor Dewey (@tddewey) for the advice!
     
    5050   
    5151    //Pull data from paste.laravel.com
    52     $url = esc_url("http://paste.laravel.com/$paste");
     52    $url = esc_url("http://laravel.io/bin/$paste");
    5353    $response = wp_remote_get($url);
    5454    $response_code = wp_remote_retrieve_response_code( $response );
     
    6060        //Parse the body of the response to pull out the relevant content.
    6161        $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;
    6466       
    6567        //Capture the paste output in an object buffer.
     
    6971                echo "<div class=\"lpe_title\">$caption</div>";
    7072            }
    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>";
    7274            echo "<pre class=\"prettyprint linenums \" style=\"height: $height;\">";
    7375            echo htmlentities($code);
  • laravel-paste-embed/tags/1.4/readme.txt

    r825729 r854439  
    11=== Laravel-Paste-Embed ===
    22Contributors: rydurham
    3 Donate link: http://www.ryandurham.com/category/code/
     3Donate link: http://www.ryandurham.com/projects
    44Tags: Laravel Paste
    55Requires at least: 3.3
    6 Tested up to: 3.6
    7 Stable tag: 1.3
     6Tested up to: 3.8
     7Stable tag: 1.4
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 A WordPress plugin for embedding text from paste.laravel.com.
     11A WordPress plugin for embedding text from laravel.io/bin.
    1212
    1313== Description ==
    1414
    15 A Wordpress plugin to embed code from paste.laravel.com. 
     15A Wordpress plugin to embed code from laravel.io/bin 
    1616
    1717== Installation ==
     
    19191. Upload the `laravel-paste-embed` folder to the `/wp-content/plugins/` directory
    20202. Activate the plugin through the 'Plugins' menu in WordPress
    21 3. Go to paste.laravel.com 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://paste.laravel.com/cJ9
     213. Go to laravel.io/bin and create the paste you are going to embed in your page or post.
     224. Grab the identifying bit from the end of the URL. 'cJ9' in this case: http://laravel.io/bin/cJ9
    23235. In your page or post add this shortcode, with the relevant part of the URL in question: [lpe paste='cJ9']
    2424
Note: See TracChangeset for help on using the changeset viewer.