| @@ -2,21 +2,20 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | Plugin Name: Simple Code Embed |
| 4 | 4 | Plugin URI: http://www.artiss.co.uk/simple-code-embed |
| 5 | 5 | Description: Allows you to embed code into your posts & pages |
| 6 | -Version: 1.2 | |
| 6 | +Version: 1.3 | |
| 7 | 7 | Author: David Artiss |
| 8 | 8 | Author URI: http://www.artiss.co.uk |
| 9 | 9 | */ |
| 10 | -add_filter('the_content', 'simple_code_embed'); | |
| 10 | +add_filter('the_content','simple_code_embed'); | |
| 11 | 11 | function simple_code_embed($content) { |
| 12 | 12 | global $post; |
| 13 | 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); | |
| 14 | + while ($loop<21) { | |
| 15 | + $html=get_post_meta($post->ID,"CODE".$loop,false); | |
| 16 | + $content=str_replace("%CODE".$loop."%",$html[0],$content); | |
| 18 | 17 | $loop++; |
| 19 | 18 | } |
| 20 | 19 | return $content; |
| 21 | 20 | } |
| 22 | 21 | ?> |