summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/easy-table/easy-table.php')
-rw-r--r--plugins/easy-table/easy-table.php56
1 files changed, 14 insertions, 42 deletions
diff --git a/plugins/easy-table/easy-table.php b/plugins/easy-table/easy-table.php
index 4bfe2854..1ade56fc 100644
--- a/plugins/easy-table/easy-table.php
+++ b/plugins/easy-table/easy-table.php
@@ -4,7 +4,7 @@ Plugin Name: Easy Table
Plugin URI: http://takien.com/
Description: Create table in post, page, or widget in easy way.
Author: Takien
-Version: 1.6
+Version: 1.8
Author URI: http://takien.com/
*/
@@ -106,7 +106,7 @@ function __construct(){
private function easy_table_base($return){
$easy_table_base = Array(
'name' => 'Easy Table',
- 'version' => '1.6',
+ 'version' => '1.8',
'plugin-domain' => 'easy-table'
);
return $easy_table_base[$return];
@@ -570,23 +570,24 @@ function themes(){
}
return $themes;
}
-function theme_content() {
- if(!isset($_GET['edit'])) {
- return false;
- }
- $theme = $_GET['edit'];
- $dir = plugin_dir_path(__FILE__).'themes/';
- if(is_writable($dir.$theme.'/style.css')) {
- return file_get_contents($dir.$theme.'/style.css');
- }
-}
+
/**
* Register plugin setting
+* @since: 1.7 add sanitize_callback
*/
function easy_table_register_setting() {
- register_setting('easy_table_option_field', 'easy_table_plugin_option');
+ $args = array('sanitize_callback'=> array(&$this,'easy_table_sanitize_callback'));
+ register_setting('easy_table_option_field', 'easy_table_plugin_option', $args);
}
+/**
+* Add sanitize_callback to register_setting to filter the options value
+* @since: 1.7
+*/
+
+function easy_table_sanitize_callback ( $value ) {
+ return filter_var( $value,FILTER_CALLBACK, array("options"=>"strip_tags"));
+}
/**
* Render form
* @param array
@@ -1085,35 +1086,6 @@ col4,col5,col6
</div>
<div class="clear"></div>
-<?php elseif($_GET['gettab'] == 'themes') : ?>
- <h3><?php _e('Easy Table theme editor');?></h3>
-
- <div class="row">
- <div class="columns nine">
- <textarea name="" id="easy-table-theme-editor"><?php echo esc_textarea($this->theme_content());?></textarea>
- <input type="submit" class="button primary" value="Save"/>
- </div>
- <div class="columns three">
- <ul>
- <?php
- foreach($this->themes() as $theme) {
- echo '
- <li><a href="#">'.$theme.'</a>
- <a href="options-general.php?page=easy-table&gettab=themes&edit='.$theme.'">edit</a>
- <a href="&edit-theme=1&clone=1#">clone</a>
- <a href="#">delete</a>
- <a href="#">preview</a>
- </li>';
- }
- ?>
- </ul>
- <form action="">
- New theme: <br/>
- <input type="text" value="" placeholder="Theme name" name="themename"/>
- <input type="submit" value="Create"/>
- </form>
- </div>
- </div>
<?php elseif($_GET['gettab'] == 'support') : ?>
<p>To ask question, please visit this plugin support on WordPress.org</p>