Changeset 2094565
- Timestamp:
- 05/24/2019 02:06:25 PM (7 years ago)
- Location:
- snappy-year-shortcode
- Files:
-
- 1 added
- 8 edited
-
assets/banner-1544x500-rtl.jpg (modified) (previous)
-
assets/banner-1544x500.jpg (modified) (previous)
-
assets/banner-772x250-rtl.jpg (modified) (previous)
-
assets/banner-772x250.jpg (modified) (previous)
-
assets/icon-128x128.jpg (modified) (previous)
-
assets/icon-256x256.jpg (modified) (previous)
-
trunk/index.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/snappy-year-shortcode.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
snappy-year-shortcode/trunk/readme.txt
r2081525 r2094565 1 1 === Snappy Year Shortcode === 2 2 Contributors: miniweblab 3 Tags: c opyright text, year, shortcode, display actual year, this year3 Tags: current year, copyright symbol, year, copyright, shortcode, current year shortcode 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=robert.ekbauer%40gmail.com¤cy_code=USD&source=url 5 Requires at least: 4.06 Tested up to: 5. 1.15 Requires at least: 2.5 6 Tested up to: 5.2.1 7 7 Requires PHP: 5.6 8 8 Stable tag: 1.0 … … 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 The easiest way to display the actual year in your copyright text or wherever you like on your site. Use the [this_year] shortcode after plugin activation.12 The easiest way displaying current year, copyright symbol and since year with shortcode. 13 13 14 14 == Description == 15 The easiest way to display the actual year in your copyright text or wherever you like on your site. Use the **[this_year]** shortcode after plugin activation in any text to show actual year. 15 The easiest way displaying current year and copyright symbol and since year in your copyright footer text or wherever else you like on your site. 16 Just use shortcodes **[Y]** for current year and **[C]** for copyright symbol after plugin activation. 17 18 If you need to display the current year, and have it always kept up to date, inserting this plugin’s **[y]** or **[y]** shortcode anywhere on your web site will do just that. 19 20 If you need to display an official Copyright notice, inserting this plugin’s **[C]** or **[c]** shortcode provides the official C with a circle around it (“©”) required legally in many countries to Copyright many forms of intellectual property. 21 22 **Other shortcodes of this plugin:** 23 * Use [cy] or [CY] to display copyright symbol © and the current year together. 24 * Use [cc] or [CC] to display copyright symbol © and the word “Copyright”. 25 * Use [csy since=”2016″] to display the symbol of copyright, first year and current year (Assuming it is currently the year 2019 ex. © 2016-2019). 26 * Use [ccsy since=”2016″] to display the symbol of copyright (©) and the word “Copyright”, first year and current year (Assuming it is currently the year 2019 ex. © Copyright 2016-2019). 27 28 16 29 17 30 == Installation == 18 1. Upload \"snappy-year-shortcode.php\" to the \"/wp-content/plugins/\" directory. 19 1. Activate the plugin through the \"Plugins\" menu in WordPress. 20 1. Place [this_year] shortcode in the footer copyright text or anywhere else on your site to display the actual year. 31 1. Upload the plugin files to the "/wp-content/plugins/snappy-year-shortcode" directory, or install the plugin through the WordPress plugins screen directly. 32 1. Activate the plugin through the "Plugins" menu in WordPress. 33 1. Place one or more shortcodes in the footer copyright text or anywhere else on your site to display the actual year and/or copyright symbol. 34 35 == Frequently Asked Questions == 36 = What are the shortcodes? = 37 * Use [y] or [Y] to display current year. 38 * Use [c] or [C] to display copyright symbol ©. 39 * Use [cy] or [CY] to display copyright symbol © and the current year together. 40 * Use [cc] or [CC] to display copyright symbol © and the word “Copyright”. 41 * Use [csy since=”2016″] to display the symbol of copyright, first year, current year (Assuming it is currently the year 2019 ex. © 2016-2019). 42 * Use [ccsy since=”2016″] to display the symbol of copyright (©) and the word “Copyright”, first year, current year (Assuming it is currently the year 2019 ex. © Copyright 2016-2019). 43 44 = How since year work? = 45 Shortcode with since year works through attribute since=””. It supports numbers only (ex. since="2016"). 46 You must enter since attribute for first year. 47 48 Example: 49 [csy since="2016"] outputs © 2016-2019 50 [ccsy since="2016"] outputs © Copyright 2016-2019 21 51 22 52 == Changelog == 23 53 = 1.0 = 24 54 * Initial release. 55 56 = 2.0 = 57 * Shortcodes and since attribute functionality added. -
snappy-year-shortcode/trunk/snappy-year-shortcode.php
r2081525 r2094565 3 3 * Plugin Name: Snappy Year Shortcode 4 4 * Plugin URI: https://wordpress.org/plugins/snappy-year-shortcode/ 5 * Description: The easiest way to display the actual year in your copyright text or wherever you like on your site. Use the [this_year] shortcodeafter plugin activation.6 * Version: 1.07 * Author: Robert Ekbauer 5 * Description: The easiest way displaying current year and copyright symbol in your copyright footer text or wherever else you like on your site. Just use shortcodes [Y] for current year and [C] for copyright symbol after plugin activation. 6 * Version: 2.0 7 * Author: Robert Ekbauer @miniweblab 8 8 * Author URI: https://profiles.wordpress.org/miniweblab/ 9 9 * License: GPL2 … … 23 23 GNU General Public License for more details. 24 24 25 Copyright 2019 Robert Ekbauer. 25 You should have received a copy of the GNU General Public License 26 along with this program; if not, write to the Free Software 27 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 28 29 Copyright 2019 Robert Ekbauer @miniweblab 26 30 */ 27 31 28 // Make sure we don't expose any info if called directly32 // make sure we don't expose any info if called directly 29 33 if ( !function_exists( 'add_action' ) ) { 30 34 echo 'Hi there! I\'m just a plugin, not much I can do when called directly.'; … … 45 49 add_action('init', 'sys_register_shortcode'); 46 50 47 // shortcode51 // registering shortcodes 48 52 function sys_register_shortcode(){ 49 53 add_shortcode('this_year', 'sys_year_shortcode'); 54 add_shortcode('Y', 'sys_year_shortcode'); 55 add_shortcode('y', 'sys_year_shortcode'); 56 add_shortcode('C', 'sys_copy_shortcode'); 57 add_shortcode('c', 'sys_copy_shortcode'); 58 add_shortcode('cc', 'sys_copy_copyright_shortcode'); 59 add_shortcode('CC', 'sys_copy_copyright_shortcode'); 60 add_shortcode('CY', 'sys_copy_year_shortcode'); 61 add_shortcode('cy', 'sys_copy_year_shortcode'); 62 add_shortcode('csy', 'sys_copy_since_year_shortcode'); 63 add_shortcode('CSY', 'sys_copy_since_year_shortcode'); 64 add_shortcode('CCSY', 'sys_copy_copyright_since_year_shortcode'); 65 add_shortcode('ccsy', 'sys_copy_copyright_since_year_shortcode'); 50 66 } 51 67 68 // current year 52 69 function sys_year_shortcode(){ 53 70 $output = date('Y'); 54 71 return $output; 55 72 } 73 74 // copyright symbol 75 function sys_copy_shortcode(){ 76 $output = "©"; 77 return $output; 78 } 79 80 // copyright symbol & copyright 81 function sys_copy_copyright_shortcode(){ 82 $output = "© Copyright"; 83 return $output; 84 } 85 86 // copyright symbol & current year 87 function sys_copy_year_shortcode(){ 88 $output = "© " . date('Y'); 89 return $output; 90 } 91 92 // since year & current year shortcode 93 function sys_copy_since_year_shortcode ($args){ 94 $since = ''; 95 if (isset($args['since'])) $since = (int)$args['since']; 96 $output = "© " . $since . "-" . date('Y'); 97 return $output; 98 } 99 100 // copyright symbol & copyright + since year & current year shortcode 101 function sys_copy_copyright_since_year_shortcode ($args){ 102 $since = ''; 103 if (isset($args['since'])) $since = (int)$args['since']; 104 $output = "© Copyright " . $since . "-" . date('Y'); 105 return $output; 106 }
Note: See TracChangeset
for help on using the changeset viewer.