Code Embed - Version 1.2

Version Description

  • Simplification of code
Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 Code Embed
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (2) hide show
  1. readme.txt +6 -3
  2. simple-code-embed.php +10 -12
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dartiss
3
  Donate link: http://tinyurl.com/bdc4uu
4
  Tags: Code, HTML, JavaScript, XHTML, Embed, YouTube
5
  Requires at least: 2.0.0
6
- Tested up to: 2.8
7
- Stable tag: 1.1
8
 
9
  Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
10
 
@@ -48,4 +48,7 @@ Feel free to report any problems, or suggestions for enhancements, to me either
48
  = 1.1 =
49
  * The instructions have been corrected (thanks to John J. Camilleri for pointing it out!)
50
  * Plugin has been tested with version 2.8 of WordPress.
51
- * No code changes have been made
 
 
 
3
  Donate link: http://tinyurl.com/bdc4uu
4
  Tags: Code, HTML, JavaScript, XHTML, Embed, YouTube
5
  Requires at least: 2.0.0
6
+ Tested up to: 2.8.5
7
+ Stable tag: 1.2
8
 
9
  Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
10
 
48
  = 1.1 =
49
  * The instructions have been corrected (thanks to John J. Camilleri for pointing it out!)
50
  * Plugin has been tested with version 2.8 of WordPress.
51
+ * No code changes have been made
52
+
53
+ = 1.2 =
54
+ * Simplification of code
simple-code-embed.php CHANGED
@@ -3,22 +3,20 @@
3
  Plugin Name: Simple Code Embed
4
  Plugin URI: http://www.artiss.co.uk/simple-code-embed
5
  Description: Allows you to embed code into your posts & pages
6
- Version: 1.1
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
10
  add_filter('the_content', 'simple_code_embed');
11
-
12
- function simple_code_embed($content) {
13
- global $post;
14
- $page=$content;
15
- $i=1;
16
- while ($i<6) {
17
- $code="CODE".$i;
18
  $html=get_post_meta($post->ID,$code,false);
19
- $page=str_replace("%".$code."%",$html[0],$page);
20
- $i++;
21
- }
22
- return $page;
23
  }
24
  ?>
3
  Plugin Name: Simple Code Embed
4
  Plugin URI: http://www.artiss.co.uk/simple-code-embed
5
  Description: Allows you to embed code into your posts & pages
6
+ Version: 1.2
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
10
  add_filter('the_content', 'simple_code_embed');
11
+ function simple_code_embed($content) {
12
+ global $post;
13
+ $loop=1;
14
+ while ($loop<6) {
15
+ $code="CODE".$loop;
 
 
16
  $html=get_post_meta($post->ID,$code,false);
17
+ $content=str_replace("%".$code."%",$html[0],$content);
18
+ $loop++;
19
+ }
20
+ return $content;
21
  }
22
  ?>