TinyMCE Templates - Version 2.1.0

Version Description

Download this release

Release Info

Developer miyauchi
Plugin Icon 128x128 TinyMCE Templates
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.0 to 2.1.0

Files changed (2) hide show
  1. readme.txt +1 -1
  2. tinymce-templates.php +10 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/jp/cgi-bin/webscr?cmd=_flow&SESSION=vVwWrw6V
4
  Tags: tinymce, Visual Editor, template
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
- Stable tag: 2.0.0
8
 
9
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
10
  You can edit and share this template with WordPress users.
4
  Tags: tinymce, Visual Editor, template
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
+ Stable tag: 2.1.0
8
 
9
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
10
  You can edit and share this template with WordPress users.
tinymce-templates.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: TinyMCE Templates
4
  Plugin URI: http://firegoby.theta.ne.jp/wp/tinymce_templates
5
  Description: Manage & Add Tiny MCE template.
6
  Author: Takayuki Miyauchi
7
- Version: 2.0.0
8
  Author URI: http://firegoby.theta.ne.jp/
9
  */
10
 
@@ -39,7 +39,7 @@ new tinymceTemplates();
39
 
40
 
41
  class tinymceTemplates {
42
-
43
  private $post_type = 'tinymcetemplates';
44
  private $meta_param = '_tinymcetemplates-share';
45
  private $table = 'mce_template';
@@ -93,8 +93,12 @@ function __construct()
93
 
94
  public function activation()
95
  {
 
 
 
 
96
  global $wpdb;
97
- // do update function
98
  $sql = $wpdb->prepare('show tables like %s', $wpdb->prefix.$this->table);
99
  if ($wpdb->get_var($sql)) {
100
  $sql = "select * from ".mysql_real_escape_string($wpdb->prefix.$this->table);
@@ -154,6 +158,9 @@ public function admin_head(){
154
  if (get_post_type() === $this->post_type) {
155
  global $hook_suffix;
156
  if ($hook_suffix === 'post.php' || $hook_suffix === 'post-new.php') {
 
 
 
157
  echo '<style>#visibility{display:none;}</style>';
158
  }
159
  }
4
  Plugin URI: http://firegoby.theta.ne.jp/wp/tinymce_templates
5
  Description: Manage & Add Tiny MCE template.
6
  Author: Takayuki Miyauchi
7
+ Version: 2.1.0
8
  Author URI: http://firegoby.theta.ne.jp/
9
  */
10
 
39
 
40
 
41
  class tinymceTemplates {
42
+ private $db_version = '2';
43
  private $post_type = 'tinymcetemplates';
44
  private $meta_param = '_tinymcetemplates-share';
45
  private $table = 'mce_template';
93
 
94
  public function activation()
95
  {
96
+ if (get_option("tinymce_templates_db_version") == $this->db_version) {
97
+ return;
98
+ }
99
+
100
  global $wpdb;
101
+ update_option("tinymce_templates_db_version", $this->db_version);
102
  $sql = $wpdb->prepare('show tables like %s', $wpdb->prefix.$this->table);
103
  if ($wpdb->get_var($sql)) {
104
  $sql = "select * from ".mysql_real_escape_string($wpdb->prefix.$this->table);
158
  if (get_post_type() === $this->post_type) {
159
  global $hook_suffix;
160
  if ($hook_suffix === 'post.php' || $hook_suffix === 'post-new.php') {
161
+ if (get_option("tinymce_templates_db_version") != $this->db_version) {
162
+ $this->activation();
163
+ }
164
  echo '<style>#visibility{display:none;}</style>';
165
  }
166
  }