Skip to content

Commit

Permalink
🚀 Release: v1.3.0
Browse files Browse the repository at this point in the history
Merge pull request #11 from warengonzaga/dev
  • Loading branch information
warengonzaga authored Feb 17, 2024
2 parents 0720908 + b40142f commit 686216e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ It will appear like this...

> Copyright © 20xx Site Name, All Rights Reserved.
If you want to add starting year using `year` attribute, it will appear like this...

`[uyf_wp year="2020"]`

It will appear like this...

> Copyright © 2020-20xx Site Name, All Rights Reserved.
## 🎯 Contributing

Contributions are welcome, create a pull request to this repo and I will review your code. Please consider to submit your pull request to the `dev` branch. Thank you!

Read the project's [contributing guide](./CONTRIBUTING.md) for more info.
Read the project's [contributing guide](./contributing.md) for more info.

## 🐛 Issues

Expand All @@ -51,7 +59,7 @@ Please report any issues and bugs by [creating a new issue here](https://github.
## 📋 Code of Conduct

Read the project's [code of conduct](./CODE_OF_CONDUCT.md).
Read the project's [code of conduct](./code_of_conduct.md).

## 📃 License

Expand Down
8 changes: 8 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ It will appear like this...

> Copyright © 20xx Site Name, All Rights Reserved.

If you want to add starting year using `year` attribute, it will appear like this...

`[uyf_wp year="2020"]`

It will appear like this...

> Copyright © 2020-20xx Site Name, All Rights Reserved.

== Frequently Asked Questions ==

= When to use this? =
Expand Down
24 changes: 18 additions & 6 deletions update-your-footer-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
* Plugin Name: Update Your Footer WP
* Plugin URI: https://github.com/warengonzaga/update-your-footer-wp
* Description: Simple and lightweight WordPress shortcode plugin to automagically update your footer year notice. No annoying ads!
* Version: 1.2.2
* Author: Waren Gonzaga
* Author URI: https://warengonzaga.com
* Text Domain: update-your-footer-wp
* Domain Path: /languages
* Version: 1.3.0
* Requires at least: 5.2
* Requires PHP: 7.4
* Author: Waren Gonzaga
* Author URI: https://warengonzaga.com/
* License: GPL v3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: update-your-footer-wp
* Domain Path: /languages
*/

/**
Expand All @@ -24,8 +28,16 @@ function update_your_footer( $atts ) {
$site_url = get_bloginfo( 'url' );
$site_name = get_bloginfo( 'name' );

// check if year attribute is set
if ( isset( $atts['year'] ) ) {
$start_year = intval( $atts['year'] );
$year_range = $start_year . '-' . $year;
} else {
$year_range = $year;
}

// output data
return __( 'Copyright', 'update-your-footer-wp' ) . ' &copy; ' . esc_html( $year ) . ' <a href="' . esc_url( $site_url ) . '">' . esc_html( $site_name ) . '</a>, ' . __( 'All Rights Reserved', 'update-your-footer-wp' ) . '.';
return __( 'Copyright', 'update-your-footer-wp' ) . ' &copy; ' . esc_html( $year_range ) . ' <a href="' . esc_url( $site_url ) . '">' . esc_html( $site_name ) . '</a>, ' . __( 'All Rights Reserved', 'update-your-footer-wp' ) . '.';
}

// wordpress hook
Expand Down

0 comments on commit 686216e

Please sign in to comment.