TinyMCE Templates - Version 4.0.1

Version Description

Download this release

Release Info

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

Code changes from version 4.0.0 to 4.0.1

Files changed (4) hide show
  1. .svnignore +10 -0
  2. editor.css +0 -4
  3. readme.txt +1 -1
  4. tinymce-templates.php +13 -4
.svnignore ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ bin
3
+ tests
4
+ .gitignore
5
+ .travis.yml
6
+ composer.json
7
+ composer.lock
8
+ phpunit.xml
9
+ assets
10
+ README.md
editor.css CHANGED
@@ -5,7 +5,3 @@ body#tinymce.wp-editor table {
5
  body#tinymce.wp-editor th,td {
6
  border: 1px dashed #cccccc;
7
  }
8
-
9
- body#tinymce.wp-editor strong {
10
- color: #ff0000;
11
- }
5
  body#tinymce.wp-editor th,td {
6
  border: 1px dashed #cccccc;
7
  }
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: miyauchi
3
  Tags: tinymce, Visual Editor, template
4
  Requires at least: 4.0
5
  Tested up to: 4.1
6
- Stable tag: 4.0.0
7
 
8
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
9
  You can edit and share this template with WordPress users.
3
  Tags: tinymce, Visual Editor, template
4
  Requires at least: 4.0
5
  Tested up to: 4.1
6
+ Stable tag: 4.0.1
7
 
8
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
9
  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: https://github.com/miya0001/tinymce-templates
5
  Description: TinyMCE Templates plugin will enable to use HTML template on WordPress Visual Editor.
6
  Author: Takayuki Miyauchi
7
- Version: 4.0.0
8
  Author URI: https://github.com/miya0001/
9
  Domain Path: /languages
10
  Text Domain: tinymce_templates
@@ -138,9 +138,18 @@ class tinymceTemplates {
138
  */
139
  public function template_shortcode( $p )
140
  {
141
- if ( isset( $p['id'] ) && $p['id'] ) {
 
 
 
 
 
 
142
  $post = get_post( $p['id'] );
143
- return apply_filters( 'the_content', $post->post_content );
 
 
 
144
  }
145
  }
146
 
@@ -429,7 +438,7 @@ class tinymceTemplates {
429
  */
430
  if ($p->post_type === $this->post_type) {
431
  if ( isset( $_POST['is_shortcode'] ) && $_POST['is_shortcode'] ) {
432
- update_post_meta( $id, 'insert_as_shortcode', 1 );
433
  } else {
434
  delete_post_meta( $id, 'insert_as_shortcode' );
435
  }
4
  Plugin URI: https://github.com/miya0001/tinymce-templates
5
  Description: TinyMCE Templates plugin will enable to use HTML template on WordPress Visual Editor.
6
  Author: Takayuki Miyauchi
7
+ Version: 4.0.1
8
  Author URI: https://github.com/miya0001/
9
  Domain Path: /languages
10
  Text Domain: tinymce_templates
138
  */
139
  public function template_shortcode( $p )
140
  {
141
+ if ( isset( $p['id'] ) && intval( $p['id'] ) ) {
142
+ $args = array(
143
+ 'ID' => $p['id'],
144
+ 'post_status' => 'publish',
145
+ 'post_type' => 'tinymcetemplates'
146
+ );
147
+
148
  $post = get_post( $p['id'] );
149
+
150
+ if ( $post && get_post_meta( $p['id'], 'insert_as_shortcode', true ) ) {
151
+ return apply_filters( 'the_content', $post->post_content );
152
+ }
153
  }
154
  }
155
 
438
  */
439
  if ($p->post_type === $this->post_type) {
440
  if ( isset( $_POST['is_shortcode'] ) && $_POST['is_shortcode'] ) {
441
+ update_post_meta( $id, 'insert_as_shortcode', true );
442
  } else {
443
  delete_post_meta( $id, 'insert_as_shortcode' );
444
  }