inline-js 0.2 — wordpress plugin

留个关于inline-js插件的更新记录

inline-js 0.2 —— wordpress plugin

本插件可在文章或页面中插入javascript或别的html等等不希望被wordperss本身重新格式化的内容。

Plugin Name: Inline Javascript Plugin
Plugin URI: http://www.ooso.net/index.php/inline-js/
Feed URI: http://www.ooso.net/index.php/feed/
Description: Plugin that insert inline javascript in Posts/Pages
Version: 0.2
Author: Volcano
Author URI: http://www.ooso.net

Usage

  • Unzip
  • Copy inline-js.php to direcotry wp-contents/plugin and activate it
  • Use <inline> and </inline> tag around the javascript,and post it
  • Ok

Source code

<?php
/*
Plugin Name: Inline Javascript Plugin
Plugin URI: http://www.ooso.net/
Feed URI: 
Description: Plugin that insert inline javascript in Posts/Pages
Version: 0.2
Author: Volcano
Author URI: http://www.ooso.net
*/
 
function inline_javascript($content){
    $str = preg_replace('/(.*?)<\/inline>/is', '$1', $content);
    if($str != $content) {
        echo $str;
        $str = '';
    }
    return $str;
}
 
add_filter('the_content', 'inline_javascript', 0);
?> 

Download

latest inline-js plugin

One Reply to “inline-js 0.2 — wordpress plugin”

Leave a Reply

Your email address will not be published.