Changeset 494545
- Timestamp:
- 01/24/2012 10:06:41 AM (14 years ago)
- Location:
- custom-smilies-directory
- Files:
-
- 3 added
- 2 edited
-
tags/1.1 (added)
-
tags/1.1/custom-smilies-directory.php (added)
-
tags/1.1/readme.txt (added)
-
trunk/custom-smilies-directory.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-smilies-directory/trunk/custom-smilies-directory.php
r494365 r494545 4 4 Plugin URI: http://plugins.josepardilla.com/custom-smilies-directory/ 5 5 Description: Light plugin that tells WordPress to load Smilies from your theme's directory. This allows you to use custom Smilies without loosing them when you update WordPress. 6 Version: 1. 06 Version: 1.1 7 7 Author: José Pardilla 8 8 Author URI: http://josepardilla.com/ 9 10 9 */ 11 10 … … 18 17 * 19 18 * @global array $wpsmiliestrans 20 * @since 2.8.019 * @since 1.0 21 20 * 22 21 * @param string $smiley Smiley code to convert to image. … … 39 38 } 40 39 40 41 41 /** 42 42 * Convert text equivalent of smilies to images. … … 45 45 * used in the function isn't empty. 46 46 * 47 * @since 0.7147 * @since 1.0 48 48 * @uses $wp_smiliessearch 49 49 * … … 74 74 75 75 /** 76 * Hook76 * Main Hook 77 77 */ 78 78 function jpm_custom_smilies_init() { 79 remove_filter( 'the_content', 'convert_smilies' ); 80 remove_filter( 'the_excerpt', 'convert_smilies' ); 81 remove_filter( 'comment_text', 'convert_smilies' ); 82 add_filter( 'the_content', 'jpm_convert_smilies' ); 83 add_filter( 'the_excerpt', 'jpm_convert_smilies' ); 84 add_filter( 'comment_text', 'jpm_convert_smilies' ); 79 $smilies_path = STYLESHEETPATH . "/smilies/"; 80 if( file_exists($smilies_path) ) { 81 remove_filter( 'the_content', 'convert_smilies' ); 82 remove_filter( 'the_excerpt', 'convert_smilies' ); 83 remove_filter( 'comment_text', 'convert_smilies' ); 84 add_filter( 'the_content', 'jpm_convert_smilies' ); 85 add_filter( 'the_excerpt', 'jpm_convert_smilies' ); 86 add_filter( 'comment_text', 'jpm_convert_smilies' ); 87 } else { 88 add_action('admin_notices','jpm_convert_smilies_warning'); 89 } 90 } 91 add_action( 'init', 'jpm_custom_smilies_init' ); 92 93 94 /** 95 * Check for smilies directory in theme 96 * 97 * Will check that the smilies directory exists in the theme, and if it doesn't 98 * show an admin panel error to let the user know. 99 * 100 * @since 1.1 101 * 102 */ 103 function jpm_convert_smilies_warning() { 104 echo '<div id="jpm-convert-smilies-warning" class="error"><p><strong>Custom Smilies Directory needs your attenttion:</strong> \'/smilies/\' directory not found in the current theme. You have to upload your new smilies to your theme directory for them to work!</p></div>'; 85 105 } 86 106 87 add_action( 'init', 'jpm_custom_smilies_init' ); 107 88 108 ?> -
custom-smilies-directory/trunk/readme.txt
r494374 r494545 4 4 Requires at least: 2.8 5 5 Tested up to: 3.3 6 Stable tag: 1. 06 Stable tag: 1.1 7 7 License: GPL/MIT 8 8 … … 13 13 14 14 Custom Smilies Directory is a plugin that tells WordPress to load Smilies from your theme's directory. This allows you to use custom Smilies without loosing them when you update WordPress. 15 16 Since version 1.1 plugin will check that the smilies folder exists in the active theme. If it doesn't, it will load the default WordPress smilies and show an error notice in the admin panel letting the user know he has to upload the smilies to the theme directory. 15 17 16 18 … … 24 26 This changelog is for the WordPress plugin. For the Fancybox main changelog go to its [home page](http://fancybox.net/changelog/). 25 27 28 = 1.1 = 29 * Plugin now checks that the smilies folder exists in the active theme. If it doesn't, it loads the default WordPress smilies and shows an error notice in the admin panel letting the user know he has to upload the smilies to the theme directory. 30 26 31 = 1.0 = 27 32 * Initial release.
Note: See TracChangeset
for help on using the changeset viewer.