Version Description
- Version details as HTML comments were being output whether an embed existed or not - corrected
=
Download this release
Release Info
Developer | dartiss |
Plugin | Code Embed |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.4.1
- readme.txt +10 -4
- simple-code-embed.php +10 -4
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://artiss.co.uk/donate
|
|
4 |
Tags: Embed, Code, Script, HTML, JavaScript, XHTML, YouTube, Video
|
5 |
Requires at least: 2.0.0
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 1.4
|
8 |
|
9 |
Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
|
10 |
|
@@ -37,14 +37,14 @@ The plugin has a settings screen where you can make 2 changes...
|
|
37 |
|
38 |
== Installation ==
|
39 |
|
40 |
-
1. Upload the entire simple-code-embed folder to your wp-content/plugins
|
41 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
42 |
|
43 |
== Frequently Asked Questions ==
|
44 |
|
45 |
= How can I get help or request possible changes =
|
46 |
|
47 |
-
Feel free to report any problems, or suggestions for enhancements, to me either via my contact form or by the plugins homepage
|
48 |
|
49 |
= My code doesn't work =
|
50 |
|
@@ -69,10 +69,16 @@ If you code contains the characters `]]>` then you'll find that it doesn't - Wor
|
|
69 |
= 1.4 =
|
70 |
* Option screen which allows you to specify the maximum number of possible embeds per post and the embed word
|
71 |
|
|
|
|
|
|
|
72 |
== Upgrade Notice ==
|
73 |
|
74 |
= 1.3 =
|
75 |
* Upgrade if you'd like to be able to embed more than 5 scripts on a single page
|
76 |
|
77 |
= 1.4 =
|
78 |
-
* Update to specify your own embed word and max. embeds per post
|
|
|
|
|
|
4 |
Tags: Embed, Code, Script, HTML, JavaScript, XHTML, YouTube, Video
|
5 |
Requires at least: 2.0.0
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 1.4.1
|
8 |
|
9 |
Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
|
10 |
|
37 |
|
38 |
== Installation ==
|
39 |
|
40 |
+
1. Upload the entire `simple-code-embed` folder to your `wp-content/plugins/` directory.
|
41 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
42 |
|
43 |
== Frequently Asked Questions ==
|
44 |
|
45 |
= How can I get help or request possible changes =
|
46 |
|
47 |
+
Feel free to report any problems, or suggestions for enhancements, to me either via [my contact form](http://www.artiss.co.uk/contact "Contact Me") or by [the plugins' homepage](http://www.artiss.co.uk/simple-code-embed "Simple Code Embed").
|
48 |
|
49 |
= My code doesn't work =
|
50 |
|
69 |
= 1.4 =
|
70 |
* Option screen which allows you to specify the maximum number of possible embeds per post and the embed word
|
71 |
|
72 |
+
= 1.4.1 =
|
73 |
+
* Version details as HTML comments were being output whether an embed existed or not - corrected
|
74 |
+
|
75 |
== Upgrade Notice ==
|
76 |
|
77 |
= 1.3 =
|
78 |
* Upgrade if you'd like to be able to embed more than 5 scripts on a single page
|
79 |
|
80 |
= 1.4 =
|
81 |
+
* Update to specify your own embed word and max. embeds per post
|
82 |
+
|
83 |
+
= 1.4.1 =
|
84 |
+
* Minor bug fix
|
simple-code-embed.php
CHANGED
@@ -3,13 +3,13 @@
|
|
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.4
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
10 |
add_filter('the_content','simple_code_embed');
|
11 |
add_action('admin_menu','simple_code_embed_menu');
|
12 |
-
define('simple_code_embed_version','1.4');
|
13 |
|
14 |
// Main function to embed code
|
15 |
function simple_code_embed($content) {
|
@@ -17,13 +17,19 @@ function simple_code_embed($content) {
|
|
17 |
$options=get_option("simple_code_embed");
|
18 |
if (!is_array($options)) {$options=array('prefix'=>'CODE','number'=>'20');}
|
19 |
global $post;
|
|
|
20 |
$loop=1;
|
21 |
while ($loop<($options['number'])+1) {
|
22 |
$html=get_post_meta($post->ID,$options['prefix'].$loop,false);
|
23 |
-
$
|
|
|
|
|
|
|
|
|
24 |
$loop++;
|
25 |
}
|
26 |
-
|
|
|
27 |
}
|
28 |
|
29 |
// Define a dashboard menu option
|
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.4.1
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
10 |
add_filter('the_content','simple_code_embed');
|
11 |
add_action('admin_menu','simple_code_embed_menu');
|
12 |
+
define('simple_code_embed_version','1.4.1');
|
13 |
|
14 |
// Main function to embed code
|
15 |
function simple_code_embed($content) {
|
17 |
$options=get_option("simple_code_embed");
|
18 |
if (!is_array($options)) {$options=array('prefix'=>'CODE','number'=>'20');}
|
19 |
global $post;
|
20 |
+
$changed=false;
|
21 |
$loop=1;
|
22 |
while ($loop<($options['number'])+1) {
|
23 |
$html=get_post_meta($post->ID,$options['prefix'].$loop,false);
|
24 |
+
$search="%".$options['prefix'].$loop."%";
|
25 |
+
if (strpos($content,$search)!==false) {
|
26 |
+
$content=str_replace($search,$html[0],$content);
|
27 |
+
$changed=true;
|
28 |
+
}
|
29 |
$loop++;
|
30 |
}
|
31 |
+
if ($changed) {$content="<!-- ".$plugin_name." v".simple_code_embed_version." | http://www.artiss.co.uk/".str_replace(" ","-",strtolower($plugin_name))." -->\n".$content.="<!-- End of ".$plugin_name." code -->\n";}
|
32 |
+
return $content;
|
33 |
}
|
34 |
|
35 |
// Define a dashboard menu option
|