Version Description
- Increased limit of number of code embeds from 5 to 20
=
Download this release
Release Info
Developer | dartiss |
Plugin | Code Embed |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- readme.txt +13 -5
- simple-code-embed.php +5 -6
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.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
|
10 |
|
@@ -14,7 +14,7 @@ As you probably know if you put code directly into your post or page, it is ofte
|
|
14 |
|
15 |
This plugin makes use of the Custom Fields facility when creating/editing posts and pages.
|
16 |
|
17 |
-
Add a custom field named `CODEx`, where x is a number between 1 and
|
18 |
|
19 |
Now, in your post or page simply add a reference to `%CODEx%` (again where x is the number that you used before).
|
20 |
|
@@ -47,8 +47,16 @@ Feel free to report any problems, or suggestions for enhancements, to me either
|
|
47 |
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.9.2
|
7 |
+
Stable tag: 1.3
|
8 |
|
9 |
Embed code, whether HTML or JavaScript, directly in your posts and pages. Ideal for showing YouTube videos!
|
10 |
|
14 |
|
15 |
This plugin makes use of the Custom Fields facility when creating/editing posts and pages.
|
16 |
|
17 |
+
Add a custom field named `CODEx`, where x is a number between 1 and 20 (this allows you to have up to 20 pieces of embedded code per page or post). In the value field place your embedded code - this can be HTML, XHTML, JavaScript, etc. Server side languages, such as PHP, doesn't work.
|
18 |
|
19 |
Now, in your post or page simply add a reference to `%CODEx%` (again where x is the number that you used before).
|
20 |
|
47 |
|
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
|
55 |
+
|
56 |
+
= 1.3 =
|
57 |
+
* Increased limit of number of code embeds from 5 to 20
|
58 |
+
|
59 |
+
== Upgrade Notice ==
|
60 |
+
|
61 |
+
= 1.3 =
|
62 |
+
* Upgrade if you'd like to be able to embed more than 5 scripts on a single page
|
simple-code-embed.php
CHANGED
@@ -3,18 +3,17 @@
|
|
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.
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
10 |
-
add_filter('the_content',
|
11 |
function simple_code_embed($content) {
|
12 |
global $post;
|
13 |
$loop=1;
|
14 |
-
while ($loop<
|
15 |
-
$
|
16 |
-
$
|
17 |
-
$content=str_replace("%".$code."%",$html[0],$content);
|
18 |
$loop++;
|
19 |
}
|
20 |
return $content;
|
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.3
|
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<21) {
|
15 |
+
$html=get_post_meta($post->ID,"CODE".$loop,false);
|
16 |
+
$content=str_replace("%CODE".$loop."%",$html[0],$content);
|
|
|
17 |
$loop++;
|
18 |
}
|
19 |
return $content;
|