PluginProbe
Code Embed / 1.1
Code Embed v1.1
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 +21 -48 2.41.1 View file →
@@ -1,51 +1,24 @@
1 1 <?php
2 -/**
3 - * Code Embed
4 - *
5 - * @package Code-Embed
6 - * @author David Artiss
7 - * @license GPL-2.0-or-later
8 - *
9 - * Plugin Name: Code Embed
10 - * Plugin URI: https://wordpress.org/plugins/simple-embed-code/
11 - * Description: Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.
12 - * Version: 2.4
13 - * Requires at least: 4.6
14 - * Requires PHP: 7.4
15 - * Author: David Artiss
16 - * Author URI: https://artiss.blog
17 - * Text Domain: simple-embed-code
18 - * License: GPL v2 or later
19 - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
20 - *
21 - * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
22 - * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
23 - * that you can use any other version of the GPL.
24 - *
25 - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
26 - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 - */
2 +/*
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');
28 11
29 -define( 'CODE_EMBED_VERSION', '2.4' );
30 -
31 -// Define global to hold the plugin base file name.
32 -
33 -if ( ! defined( 'CODE_EMBED_PLUGIN_BASE' ) ) {
34 - define( 'CODE_EMBED_PLUGIN_BASE', plugin_basename( __FILE__ ) );
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++;
35 21 }
36 -
37 -// Include all the various functions.
38 -
39 -$functions_dir = plugin_dir_path( __FILE__ ) . 'includes/';
40 -
41 -require_once $functions_dir . 'initialise.php'; // Initialisation scripts.
42 -
43 -require_once $functions_dir . 'add-scripts.php'; // Add scripts to the main theme.
44 -
45 -require_once $functions_dir . 'add-embeds.php'; // Filter to apply code embeds.
46 -
47 -require_once $functions_dir . 'shared.php'; // Functions shared across all my plugins.
48 -
49 -require_once $functions_dir . 'screens.php'; // Add settings and tools screens.
50 -
51 -require_once $functions_dir . 'meta-box.php'; // Suppress meta-boxes.
22 +return $page;
23 +}
24 +?>