Changeset 623890
- Timestamp:
- 11/12/2012 05:59:24 AM (13 years ago)
- Location:
- wp-shortcode-shield/trunk
- Files:
-
- 3 added
- 1 deleted
- 2 edited
-
includes (added)
-
includes/wp-plugin-base (added)
-
includes/wp-plugin-base/wp-plugin-base.php (added)
-
readme.txt (modified) (3 diffs)
-
wp-plugin-base (deleted)
-
wp-shortcode-shield.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-shortcode-shield/trunk/readme.txt
r536549 r623890 3 3 Donate link: http://www.vicchi.org/codeage/donate/ 4 4 Tags: page, post, shortcode, documentation 5 Requires at least: 3.3 6 Tested up to: 3.3.2 7 Stable tag: 1.0.1 5 Requires at least: 3.4 6 Tested up to: 3.4.2 7 Stable tag: 1.1.0 8 License: GPLv2 or later 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 10 9 11 Allows posts and pages to easily document WordPress shortcodes without the shortcode being expanded. … … 62 64 = How do I get help or support for this plugin? = 63 65 64 In short, very easily. But before you read any further, take a look at [Asking For WordPress Plugin Help And Support Without Tears](http://www.vicchi.org/2012/03/31/asking-for-wordpress-plugin-help-and-support-without-tears/) before firing off a question. In order of preference, you can ask a question on the [WordPress support forum](http://wordpress.org/ tags/wp-shortcode-shield?forum_id=10); this is by far the best way so that other users can follow the conversation. You can ask me a question on Twitter; I'm [@vicchi](http://twitter.com/vicchi). Or you can drop me an email instead. I can't promise to answer your question but I do promise to answer and do my best to help.66 In short, very easily. But before you read any further, take a look at [Asking For WordPress Plugin Help And Support Without Tears](http://www.vicchi.org/2012/03/31/asking-for-wordpress-plugin-help-and-support-without-tears/) before firing off a question. In order of preference, you can ask a question on the [WordPress support forum](http://wordpress.org/support/plugin/wp-shortcode-shield); this is by far the best way so that other users can follow the conversation. You can ask me a question on Twitter; I'm [@vicchi](http://twitter.com/vicchi). Or you can drop me an email instead. I can't promise to answer your question but I do promise to answer and do my best to help. 65 67 66 68 = Is there a web site for this plugin? = … … 78 80 == Changelog == 79 81 80 The current version is 1.0 (2012.04.24) 82 The current version is 1.1.0 (2012.11.12) 83 84 = 1.1.0 = 85 * Released 2012.11.12 86 * Other: Upgraded plugin to new version of WP_PluginBase to prevent class name clashes during future upgrades. 87 * Other: Ensure WP_ShortCodeShield is not already defined and instantiate as a singleton. 88 * Other: Rename misleading plugin constants (they're square brackets not angle brackets) 89 90 = 1.0.1 = 91 * Released 2012.08.29 92 * Fixed: Ensure WP_PluginBase is properly included and defined. 81 93 82 94 = 1.0 = 95 * Released 2012.07.17 83 96 * This is the first version of WP Shortcode Shield. 84 97 85 98 == Upgrade Notice == 86 99 100 = 1.1.0 = 101 Maintenance version; upgraded plugin to new version of WP_PluginBase to prevent class name clashes during future upgrades. 102 103 = 1.0.1 = 104 Fixed a bug where WP_PluginBase is properly included and defined. This is the 2nd. version of WP Shortcode Shield. 105 87 106 = 1.0 = 88 107 * This is the first version of WP Shortcode Shield. -
wp-shortcode-shield/trunk/wp-shortcode-shield.php
r536549 r623890 4 4 Plugin URI: http://www.vicchi.org/codeage/wp-shortcode-shield/ 5 5 Description: Allows posts and pages to easily document WordPress short-codes without the short-code being expanded. 6 Version: 1. 0.16 Version: 1.1.0 7 7 Author: Gary Gale 8 8 Author URI: http://www.garygale.com/ … … 12 12 define ('WPSHORTCODESHIELD_PATH', plugin_dir_path (__FILE__)); 13 13 14 require_once (WPSHORTCODESHIELD_PATH . '/ wp-plugin-base/wp-plugin-base.php');14 require_once (WPSHORTCODESHIELD_PATH . '/includes/wp-plugin-base/wp-plugin-base.php'); 15 15 16 class WP_ShortCodeShield extends WP_PluginBase { 17 static $instance; 16 if (!class_exists ('WP_ShortCodeShield')) { 17 class WP_ShortCodeShield extends WP_PluginBase_v1_1 { 18 private static $instance; 18 19 19 const LANGB = '[';20 const RANGB = ']';20 const LSQB = '['; 21 const RSQB = ']'; 21 22 22 function __construct () { 23 self::$instance = $this; 23 /** 24 * Class constructor 25 */ 24 26 25 $this->hook ('plugins_loaded'); 26 } 27 private function __construct () { 28 $this->hook ('plugins_loaded'); 29 } 27 30 28 function plugins_loaded () { 29 add_shortcode ('wp_scs', array ($this, 'shortcode')); 30 add_shortcode ('wp_shortcode_shield', array ($this, 'shortcode')); 31 } 31 /** 32 * Class singleton factory helper 33 */ 34 35 public static function get_instance () { 36 if (!isset (self::$instance)) { 37 $c = __CLASS__; 38 self::$instance = new $c (); 39 } 40 41 return self::$instance; 42 43 } 44 45 /** 46 * "plugins_loaded" action hook; called after all active plugins and pluggable 47 * functions are loaded. 48 * 49 * Add the shortcode support actions for the short form shortcode [wp_scs] and the 50 * long form shortcode [wp_shortcode_shield]. 51 */ 52 53 public function plugins_loaded () { 54 add_shortcode ('wp_scs', array ($this, 'shortcode')); 55 add_shortcode ('wp_shortcode_shield', array ($this, 'shortcode')); 56 } 32 57 33 function shortcode ($atts, $content=null) { 34 extract (shortcode_atts (array ('code' => ''), $atts)); 58 /** 59 * Shortcode handler for the [wp_scs] and [wp_shortcode_shield] shortcodes; expands 60 * the shortcode to wrap the enclosed shortcode. 61 */ 35 62 36 // Self-closing shortcode form ... 37 if (empty ($content) && !empty ($code)) { 38 return $this->enclose ($code); 63 public function shortcode ($atts, $content=null) { 64 extract (shortcode_atts (array ('code' => ''), $atts)); 65 66 // Self-closing shortcode form ... 67 if (empty ($content) && !empty ($code)) { 68 return $this->enclose ($code); 69 } 70 71 // Enclosing shortcode form ... 72 else { 73 if (strpos ($content, '[') === false) { 74 return $this->enclose ($content); 75 } 76 77 else { 78 return $content; 79 } 80 } 81 } 82 83 /** 84 * Helper function; encloses a section of content in square brackets [ ... ] 85 */ 86 87 private function enclose ($content) { 88 return self::LSQB . $content . self::RSQB; 39 89 } 40 90 41 // Enclosing shortcode form ... 42 else { 43 if (strpos ($content, '[') === false) { 44 return $this->enclose ($content); 45 } 46 47 else { 48 return $content; 49 } 50 } 51 } 52 53 function enclose ($content) { 54 return self::LANGB . $content . self::RANGB; 55 } 56 } // end-class WP_ShortCodeShield 91 } // end-class WP_ShortCodeShield 92 } // if (!class_exists ('WP_ShortCodeShield')) 57 93 58 $__wp_shortcode_shield_instance = new WP_ShortCodeShield;94 WP_ShortCodeShield::get_instance (); 59 95 60 96 ?>
Note: See TracChangeset
for help on using the changeset viewer.