Plugin Directory

Changeset 2094565


Ignore:
Timestamp:
05/24/2019 02:06:25 PM (7 years ago)
Author:
miniweblab
Message:

shortcodes added,
since year functionality added,
assets and readme.txt updated

Location:
snappy-year-shortcode
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • snappy-year-shortcode/trunk/readme.txt

    r2081525 r2094565  
    11=== Snappy Year Shortcode ===
    22Contributors: miniweblab
    3 Tags: copyright text, year, shortcode, display actual year, this year
     3Tags: current year, copyright symbol, year, copyright, shortcode, current year shortcode
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=robert.ekbauer%40gmail.com&currency_code=USD&source=url
    5 Requires at least: 4.0
    6 Tested up to: 5.1.1
     5Requires at least: 2.5
     6Tested up to: 5.2.1
    77Requires PHP: 5.6
    88Stable tag: 1.0
     
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    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.
     12The easiest way displaying current year, copyright symbol and since year with shortcode.
    1313
    1414== 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.
     15The easiest way displaying current year and copyright symbol and since year in your copyright footer text or wherever else you like on your site.
     16Just use shortcodes **[Y]** for current year and **[C]** for copyright symbol after plugin activation.
     17
     18If 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
     20If 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
    1629
    1730== 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.
     311. Upload the plugin files to the "/wp-content/plugins/snappy-year-shortcode" directory, or install the plugin through the WordPress plugins screen directly.
     321. Activate the plugin through the "Plugins" menu in WordPress.
     331. 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? =
     45Shortcode with since year works through attribute since=””. It supports numbers only (ex. since="2016").
     46You must enter since attribute for first year.
     47
     48Example:
     49[csy since="2016"] outputs © 2016-2019
     50[ccsy since="2016"] outputs © Copyright 2016-2019
    2151
    2252== Changelog ==
    2353= 1.0 =
    2454* Initial release.
     55
     56= 2.0 =
     57* Shortcodes and since attribute functionality added.
  • snappy-year-shortcode/trunk/snappy-year-shortcode.php

    r2081525 r2094565  
    33 * Plugin Name: Snappy Year Shortcode
    44 * 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] shortcode after plugin activation.
    6  * Version:     1.0
    7  * 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
    88 * Author URI:  https://profiles.wordpress.org/miniweblab/
    99 * License:     GPL2
     
    2323GNU General Public License for more details.
    2424
    25 Copyright 2019 Robert Ekbauer.
     25You should have received a copy of the GNU General Public License
     26along with this program; if not, write to the Free Software
     27Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     28
     29Copyright 2019 Robert Ekbauer @miniweblab
    2630 */
    2731 
    28  // Make sure we don't expose any info if called directly
     32 // make sure we don't expose any info if called directly
    2933if ( !function_exists( 'add_action' ) ) {
    3034    echo 'Hi there!  I\'m just a plugin, not much I can do when called directly.';
     
    4549 add_action('init', 'sys_register_shortcode');
    4650 
    47 // shortcode
     51// registering shortcodes
    4852 function sys_register_shortcode(){
    4953     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');
    5066 }
    5167 
     68 // current year
    5269 function sys_year_shortcode(){
    5370     $output = date('Y');
    5471     return $output;
    5572 }
     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
     93function sys_copy_since_year_shortcode ($args){
     94    $since = '';
     95if (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
     101function sys_copy_copyright_since_year_shortcode ($args){
     102    $since = '';
     103if (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.