PluginProbe
Code Embed / 1.0
Code Embed v1.0
2.6.4 2.6.3 2.6.2 2.6.1 trunk 1.0 1.1 1.2 1.3 1.4.1 1.5.1 1.6.1 2.0.2 2.1.2 2.2.2 2.3.9 2.4 2.5.1 2.5.2 2.6
← All changes | simple-code-embed.php +13 -11 1.21.0 View file →
@@ -2,21 +2,23 @@
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.0
7 7 Author: David Artiss
8 8 Author URI: http://www.artiss.co.uk
9 9 */
10 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;
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;
21 23 }
22 24 ?>