WordPress.org

Plugin Directory

Changeset 999000


Ignore:
Timestamp:
09/30/14 08:59:27 (3 years ago)
Author:
sauhi
Message:

Last update 1.5 version!

Location:
sau-syntax/trunk
Files:
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • sau-syntax/trunk/readme.txt

    r885493 r999000  
    1 === Plugin Name === 
     1=== Sau Syntax === 
    22Contributors: sauhi 
    33Donate link: http://hocwp.net/ 
    44Tags: syntax, syntax highlighter, sau syntax, highlighter, highlighting 
    5 Requires at least: 3.7 
    6 Tested up to: 3.9 
    7 Stable tag: 1.4 
     5Requires at least: 3.9 
     6Tested up to: 4.0 
     7Stable tag: 1.5 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1313== Description == 
    1414 
    15 Sau Syntax is the easiest way to post source code on your blog posts. You can write source code on your post or you can embed source code from GitHub Gist. 
     15Please use [SyntaxHighlighter Evolved](https://wordpress.org/plugins/syntaxhighlighter/) instead. 
    1616 
    17 = Usage = 
    18 You can write source code directly within your post or embed source code from GitHub Gist. 
     17**Recommended WordPress Plugins** 
    1918 
    20 * [saucode]Put your source code here.[/saucode] or [saucode lang="Source Code Language"]Put your source code here.[/saucode] 
    21 * [saugist id="Put Gist's ID here"] 
     19* [SB Paginate](https://wordpress.org/plugins/sb-paginate/) 
     20* [SB TBFA](https://wordpress.org/plugins/sb-tbfa/) 
    2221 
    2322= Need support = 
     
    3231== Screenshots == 
    3332 
    34 1. You can embed source code from GitHub Gist. 
    35 2. You can write source code on your own blog post. 
     33Go to [Home page](http://hocwp.net/) for more information. 
    3634 
    3735== Changelog == 
     36 
     37= 1.5 = 
     38* No more support for this plugin. 
    3839 
    3940= 1.4 = 
  • sau-syntax/trunk/syntax.php

    r885492 r999000  
    44 * Plugin URI: http://hocwp.net/blog/sau-syntax-plugin/ 
    55 * Description: Sau Syntax is the easiest way to post source code on your blog posts. 
    6  * Version: 1.4 
     6 * Version: 1.5 
    77 * Author: Sau Hi 
    88 * Author URI: http://hocwp.net 
    99 * License: GNU General Public License v3.0 
    1010 */ 
    11  
    12  
    13 function sau_syntax_script() 
    14 { 
    15     wp_enqueue_style( 'sau-syntax', plugins_url( 'css/sau-syntax-style.css' , __FILE__ ) ); 
    16     wp_enqueue_script( 'prism', plugins_url( 'js/prism.js?', __FILE__ ), array(), get_bloginfo('version'), false ); 
    17 } 
    18 add_action( 'wp_enqueue_scripts', 'sau_syntax_script' ); 
    19  
    20 class Sau_Syntax 
    21 { 
    22     function __construct() 
    23     { 
    24         if(!function_exists('add_shortcode')) 
    25         { 
    26             return; 
    27         } 
    28         add_shortcode('saugist', array(&$this, 'saugist_func')); 
    29         add_shortcode('saucode', array(&$this, 'saucode_func')); 
    30     } 
    31      
    32     function saugist_func($atts = array()) 
    33     { 
    34         extract(shortcode_atts(array('id' => ''), $atts)); 
    35         if($id=='') 
    36         { 
    37             return ''; 
    38         } 
    39         return '<script src="https://gist.github.com/'.$id.'.js"></script>'; 
    40     } 
    41      
    42     function saucode_func($atts = array(), $content = null) 
    43     { 
    44         extract(shortcode_atts(array('lang' => 'php'), $atts)); 
    45         if($lang != '') 
    46         { 
    47             $lang = 'language-'.$lang; 
    48         } 
    49         $lang = trim(strtolower($lang)); 
    50         $tmp = htmlentities($content); 
    51         return '<pre class="saupre"><code class="saucode '.$lang.'">'.$tmp.'</code></pre>'; 
    52     } 
    53 } 
    54 add_action( 'plugins_loaded', create_function( '', 'global $s_syn; $s_syn = new Sau_Syntax();' ) ); 
    55  
    56 add_filter('comment_text', 'do_shortcode'); 
    57 remove_filter( 'the_content', 'wpautop' ); 
    58 add_filter( 'the_content', 'wpautop' , 99); 
    59 add_filter( 'the_content', 'shortcode_unautop',100 ); 
    60 ?> 
Note: See TracChangeset for help on using the changeset viewer.