Plugin Directory

Changeset 2126847


Ignore:
Timestamp:
07/22/2019 07:26:26 PM (7 years ago)
Author:
miinasikk
Message:

Version 1.1

Location:
automatic-copyright-year
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • automatic-copyright-year/tags/1.1/automatic-copyright-year.php

    r1344345 r2126847  
    11<?php
    2 /*
    3  Plugin Name: Automatic Copyright Year
    4  Plugin URI: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    5  Description: Replaces '&lt;span&gt;[wpsos_year]&lt;/span&gt;' with the current year in widget texts and in the html element 'footer'
    6  Author: WPSOS
    7  Version: 1.0
    8  Author URI: http://www.wpsos.io/
    9  Licence: GPLv2 or later
     2/**
     3 * Plugin Name: Automatic Copyright Year
     4 * Plugin URI: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     5 * Description: Replaces '&lt;span&gt;[wpsos_year]&lt;/span&gt;' with the current year in widget texts and in the html element 'footer'
     6 * Author: WPSOS
     7 * Version: 1.0
     8 * Author URI: http://www.wpsos.io/
     9 * Licence: GPLv2 or later
    1010 */
     11
     12// Exit if accessed directly.
     13if ( ! defined( 'ABSPATH' ) ) {
     14    exit;
     15}
    1116
    1217/**
    1318 * Modifies the content of the text, replacing [wpsos_year] with the current year number
    14  * 
    15  * @param String $content
    16  * @return String The modified text
     19 *
     20 * @param String $content Content.
     21 * @return String The modified text.
    1722 */
    18 function wpsos_replace_copyright_year( $content ){
    19     $content = str_replace( '[wpsos_year]', date('Y'), $content );
    20     //Return the modified text
     23function wpsos_acy_replace_copyright_year( $content ) {
     24    $content = str_replace( '[wpsos_year]', date( 'Y' ), $content );
     25
     26    // Return the modified text.
    2127    return $content;
    2228}
    23 //Add filters to run the functions before displaying content on the screen
    24 add_filter( 'widget_text', 'wpsos_replace_copyright_year', 10, 1 );
    2529
    26 // Include the scripts required by the plugin
    27 function wpsos_include_scripts(){
    28     wp_enqueue_script('jquery');
    29     wp_enqueue_script( 'wpsos-copyright', plugin_dir_url( __FILE__ ) . 'script.js', array('jquery'), '1.0', true);
    30 }
    31 add_action( 'wp_enqueue_scripts', 'wpsos_include_scripts' );
     30// Add filters to run the functions before displaying content on the screen.
     31add_filter( 'widget_text', 'wpsos_acy_replace_copyright_year', 10, 1 );
    3232
    3333/**
    34  * Add links to WPSOS
     34 * Include scripts needed for the plugin.
    3535 */
    36 function wpsos_acy_set_plugin_meta( $links, $file ) {
     36function wpsos_acy_include_scripts() {
     37    wp_enqueue_script( 'jquery' );
     38    wp_enqueue_script( 'wpsos-copyright', plugin_dir_url( __FILE__ ) . 'script.js', array( 'jquery' ), '1.0', true );
     39}
     40add_action( 'wp_enqueue_scripts', 'wpsos_acy_include_scripts' );
    3741
    38     if ( strpos( $file, 'automatic-copyright-year.php' ) !== false ) {
    39 
    40         $links = array_merge( $links, array( '<a href="http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/">' . __( 'Plugin details' ) . '</a>' ) );
    41         $links = array_merge( $links, array( '<a href="http://www.wpsos.io/">WPSOS - WordPress Security & Hack Repair</a>' ) );
    42     }
    43     return $links;
     42/**
     43 * Return year number for the shortcode.
     44 *
     45 * @return string Date.
     46 */
     47function wpsos_acy_add_shortcode() {
     48    return date( 'Y' );
    4449}
    45 add_filter( 'plugin_row_meta', 'wpsos_acy_set_plugin_meta', 10, 2 );
    46 ?>
     50add_shortcode( 'wpsos_year', 'wpsos_acy_add_shortcode' );
  • automatic-copyright-year/tags/1.1/readme.txt

    r1344345 r2126847  
    11=== Automatic Copyright Year ===
    2 Contributors: citywanderer, stubgo
     2Contributors: miinasikk, citywanderer
    33Donate link: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    44Tags: copyright,shortcode,copyright year,footer copyright,widget
    55Requires at least: 3.0.1
    6 Tested up to: 4.4.2
    7 Stable tag: 1.0
     6Tested up to: 5.2.2
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020Instead of going through every site you have each year on the 1st of January and change the year manually, now it will all be done seamlessly for you. Just install the Automatic Copyright Year plugin and voila: your sites will always have an up-to-date copyright.
    2121
    22 For more information and support, check out: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    23 
    2422== Installation ==
    2523
     
    28261. Upload the folder `automatic-copyright-year` to the `/wp-content/plugins/` directory
    29272. Activate the plugin through the 'Plugins' menu in WordPress
    30 3. Add '&lt;span&gt;[wpsos_year]&lt;/span&gt;' (<span>[wpsos_year]</span>, surrounded by span tags) to a widget or to anywhere inside the html footer element
     283. Add '&lt;span&gt;[wpsos_year]&lt;/span&gt;' (<span>[wpsos_year]</span>, surrounded by span tags) as shortcode, to a widget or to anywhere inside the html footer element.
    3129
    3230== Frequently Asked Questions ==
     
    3836= Where can I get some support? =
    3937
    40 Check out our site, at: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     38Let us know via the support forum.
    4139
    4240= I have some suggestions for other options I want edited =
    4341
    44 Let us know, via: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     42Let us know via the support forum.
    4543
    4644== Screenshots ==
     
    5048== Changelog ==
    5149
     50= 1.1 =
     51* Allow using [wpsos_year] as shortcode.
     52
    5253= 1.0 =
    5354* Initial version.
  • automatic-copyright-year/trunk/automatic-copyright-year.php

    r1344345 r2126847  
    11<?php
    2 /*
    3  Plugin Name: Automatic Copyright Year
    4  Plugin URI: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    5  Description: Replaces '&lt;span&gt;[wpsos_year]&lt;/span&gt;' with the current year in widget texts and in the html element 'footer'
    6  Author: WPSOS
    7  Version: 1.0
    8  Author URI: http://www.wpsos.io/
    9  Licence: GPLv2 or later
     2/**
     3 * Plugin Name: Automatic Copyright Year
     4 * Plugin URI: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     5 * Description: Replaces '&lt;span&gt;[wpsos_year]&lt;/span&gt;' with the current year in widget texts and in the html element 'footer'
     6 * Author: WPSOS
     7 * Version: 1.0
     8 * Author URI: http://www.wpsos.io/
     9 * Licence: GPLv2 or later
    1010 */
     11
     12// Exit if accessed directly.
     13if ( ! defined( 'ABSPATH' ) ) {
     14    exit;
     15}
    1116
    1217/**
    1318 * Modifies the content of the text, replacing [wpsos_year] with the current year number
    14  * 
    15  * @param String $content
    16  * @return String The modified text
     19 *
     20 * @param String $content Content.
     21 * @return String The modified text.
    1722 */
    18 function wpsos_replace_copyright_year( $content ){
    19     $content = str_replace( '[wpsos_year]', date('Y'), $content );
    20     //Return the modified text
     23function wpsos_acy_replace_copyright_year( $content ) {
     24    $content = str_replace( '[wpsos_year]', date( 'Y' ), $content );
     25
     26    // Return the modified text.
    2127    return $content;
    2228}
    23 //Add filters to run the functions before displaying content on the screen
    24 add_filter( 'widget_text', 'wpsos_replace_copyright_year', 10, 1 );
    2529
    26 // Include the scripts required by the plugin
    27 function wpsos_include_scripts(){
    28     wp_enqueue_script('jquery');
    29     wp_enqueue_script( 'wpsos-copyright', plugin_dir_url( __FILE__ ) . 'script.js', array('jquery'), '1.0', true);
    30 }
    31 add_action( 'wp_enqueue_scripts', 'wpsos_include_scripts' );
     30// Add filters to run the functions before displaying content on the screen.
     31add_filter( 'widget_text', 'wpsos_acy_replace_copyright_year', 10, 1 );
    3232
    3333/**
    34  * Add links to WPSOS
     34 * Include scripts needed for the plugin.
    3535 */
    36 function wpsos_acy_set_plugin_meta( $links, $file ) {
     36function wpsos_acy_include_scripts() {
     37    wp_enqueue_script( 'jquery' );
     38    wp_enqueue_script( 'wpsos-copyright', plugin_dir_url( __FILE__ ) . 'script.js', array( 'jquery' ), '1.0', true );
     39}
     40add_action( 'wp_enqueue_scripts', 'wpsos_acy_include_scripts' );
    3741
    38     if ( strpos( $file, 'automatic-copyright-year.php' ) !== false ) {
    39 
    40         $links = array_merge( $links, array( '<a href="http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/">' . __( 'Plugin details' ) . '</a>' ) );
    41         $links = array_merge( $links, array( '<a href="http://www.wpsos.io/">WPSOS - WordPress Security & Hack Repair</a>' ) );
    42     }
    43     return $links;
     42/**
     43 * Return year number for the shortcode.
     44 *
     45 * @return string Date.
     46 */
     47function wpsos_acy_add_shortcode() {
     48    return date( 'Y' );
    4449}
    45 add_filter( 'plugin_row_meta', 'wpsos_acy_set_plugin_meta', 10, 2 );
    46 ?>
     50add_shortcode( 'wpsos_year', 'wpsos_acy_add_shortcode' );
  • automatic-copyright-year/trunk/readme.txt

    r1344345 r2126847  
    11=== Automatic Copyright Year ===
    2 Contributors: citywanderer, stubgo
     2Contributors: miinasikk, citywanderer
    33Donate link: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    44Tags: copyright,shortcode,copyright year,footer copyright,widget
    55Requires at least: 3.0.1
    6 Tested up to: 4.4.2
    7 Stable tag: 1.0
     6Tested up to: 5.2.2
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020Instead of going through every site you have each year on the 1st of January and change the year manually, now it will all be done seamlessly for you. Just install the Automatic Copyright Year plugin and voila: your sites will always have an up-to-date copyright.
    2121
    22 For more information and support, check out: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
    23 
    2422== Installation ==
    2523
     
    28261. Upload the folder `automatic-copyright-year` to the `/wp-content/plugins/` directory
    29272. Activate the plugin through the 'Plugins' menu in WordPress
    30 3. Add '&lt;span&gt;[wpsos_year]&lt;/span&gt;' (<span>[wpsos_year]</span>, surrounded by span tags) to a widget or to anywhere inside the html footer element
     283. Add '&lt;span&gt;[wpsos_year]&lt;/span&gt;' (<span>[wpsos_year]</span>, surrounded by span tags) as shortcode, to a widget or to anywhere inside the html footer element.
    3129
    3230== Frequently Asked Questions ==
     
    3836= Where can I get some support? =
    3937
    40 Check out our site, at: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     38Let us know via the support forum.
    4139
    4240= I have some suggestions for other options I want edited =
    4341
    44 Let us know, via: http://www.wpsos.io/wordpress-plugin-automatic-copyright-year/
     42Let us know via the support forum.
    4543
    4644== Screenshots ==
     
    5048== Changelog ==
    5149
     50= 1.1 =
     51* Allow using [wpsos_year] as shortcode.
     52
    5253= 1.0 =
    5354* Initial version.
Note: See TracChangeset for help on using the changeset viewer.