From 14d3a7f26d9d8d4f5d906e8abac7dafd6f243c37 Mon Sep 17 00:00:00 2001 From: Aldo Latino Date: Sun, 8 Nov 2020 19:15:20 +0100 Subject: [PATCH 1/2] Added links to plugin line --- private-content.php | 69 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/private-content.php b/private-content.php index bddade2..9b09f4c 100755 --- a/private-content.php +++ b/private-content.php @@ -59,11 +59,46 @@ } /** - * Include the class. + * Launch Private Content. * - * @since 5.1 + * @since 1.0 + */ +add_action( 'plugins_loaded', 'private_content_setup' ); + +/** + * Setup the plugin and fire the necessary files. + * + * @since 6.4 */ -require_once plugin_dir_path( __FILE__ ) . 'includes/class-ubn-private.php'; +function private_content_setup() { + /** + * Load the translation. + * + * @since 6.4 + */ + load_plugin_textdomain( 'private-content', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); + + /** + * Include the class. + * + * @since 5.1 + */ + require_once plugin_dir_path( __FILE__ ) . 'includes/class-ubn-private.php'; + + /** + * Add links to plugins list line. + * + * @since 6.4 + */ + add_filter( 'plugin_row_meta', 'private_content_add_links', 10, 2 ); + + /** + * Run the plugin. + * + * @since 6.4 Moved from root to the setup function. + */ + ubn_private_run(); +} /** * Instantiate the object and run the plugin. @@ -75,7 +110,33 @@ function ubn_private_run() { $ubn_private->run(); } -ubn_private_run(); +/** + * Add links to plugins list line. + * + * @param array $links The array containing links. + * @param string $file The path to the current file. + * @since 6.4 + */ +function private_content_add_links( $links, $file ) { + if ( plugin_basename( __FILE__ ) === $file ) { + // Changelog. + $changelog_url = 'https://github.com/aldolat/private-content/blob/master/CHANGELOG.md'; + $links[] = '' . esc_html__( 'Changelog', 'private-content' ) . ''; + + // Documentation. + $doc_url = 'https://github.com/aldolat/private-content/wiki'; + $links[] = '' . esc_html__( 'Documentation', 'private-content' ) . ''; + + // PDF Documentation. + $doc_url = 'https://github.com/aldolat/private-content/raw/master/documentation/private-content.pdf'; + $links[] = '' . esc_html__( 'PDF Documentation', 'private-content' ) . ''; + + // Reviews. + $rate_url = 'https://wordpress.org/support/plugin/' . basename( dirname( __FILE__ ) ) . '/reviews/#new-post'; + $links[] = '' . esc_html__( 'Rate this plugin', 'private-content' ) . ''; + } + return $links; +} /* * CODE IS POETRY From f176c003233f44d1c9c76748681384e4d60f81a4 Mon Sep 17 00:00:00 2001 From: Aldo Latino Date: Sat, 21 Nov 2020 18:02:41 +0100 Subject: [PATCH 2/2] Releasing 6.3.1 --- CHANGELOG.md | 7 +++++++ README.md | 4 ++-- changelog.txt | 5 +++++ includes/class-ubn-private.php | 2 +- languages/private-content.pot | 20 ++++++++++++++++++-- private-content.php | 2 +- readme.txt | 4 ++-- 7 files changed, 36 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d1d6a6..06f7788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [6.3.1] - 2020-11-21 +### Added +* Added new link to plugin line in the WordPress plugins management page. +### Updated +* Updated compatibility to WordPress 5.6. + ## [6.3] - 2020-03-01 ### Added * Added support for user IDs in recipient option. @@ -118,6 +124,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * First release of the plugin. [Unreleased]: https://github.com/aldolat/private-content/commits/develop +[6.3.1]: https://github.com/aldolat/private-content/compare/6.3...6.3.1 [6.3]: https://github.com/aldolat/private-content/compare/6.2...6.3 [6.2]: https://github.com/aldolat/private-content/compare/6.1...6.2 [6.1]: https://github.com/aldolat/private-content/compare/6.0...6.1 diff --git a/README.md b/README.md index 4fe17f2..93720a7 100755 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ **Donate link:** **Tags:** content, private, shortcode **Requires at least:** 3.0 -**Tested up to:** 5.5 -**Stable tag:** 6.3 +**Tested up to:** 5.6 +**Stable tag:** 6.3.1 **License:** GPLv3 or later **License URI:** diff --git a/changelog.txt b/changelog.txt index 3d77a4c..cc10acd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,10 @@ == Changelog == += 6.3.1 = + +* Added new link to plugin line in the WordPress plugins management page. +* Updated compatibility to WordPress 5.6. + = 6.3 = * Added support for user IDs in recipient option. diff --git a/includes/class-ubn-private.php b/includes/class-ubn-private.php index 82f429c..7883b41 100644 --- a/includes/class-ubn-private.php +++ b/includes/class-ubn-private.php @@ -42,7 +42,7 @@ class UBN_Private { */ public function __construct() { // Define the plugin version. - $this->plugin_version = '6.3'; + $this->plugin_version = '6.3.1'; } /** diff --git a/languages/private-content.pot b/languages/private-content.pot index cabfbea..62a035c 100644 --- a/languages/private-content.pot +++ b/languages/private-content.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the Private content plugin. msgid "" msgstr "" -"Project-Id-Version: Private content 6.3\n" +"Project-Id-Version: Private content 6.3.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/private-content\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2020-03-01T15:36:25+01:00\n" +"POT-Creation-Date: 2020-11-21T18:02:06+01:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.4.0\n" "X-Domain: private-content\n" @@ -33,3 +33,19 @@ msgstr "" #. Author URI of the plugin msgid "https://www.aldolat.it/" msgstr "" + +#: private-content.php:124 +msgid "Changelog" +msgstr "" + +#: private-content.php:128 +msgid "Documentation" +msgstr "" + +#: private-content.php:132 +msgid "PDF Documentation" +msgstr "" + +#: private-content.php:136 +msgid "Rate this plugin" +msgstr "" diff --git a/private-content.php b/private-content.php index 9b09f4c..cfb7471 100755 --- a/private-content.php +++ b/private-content.php @@ -18,7 +18,7 @@ * Plugin URI: https://dev.aldolat.it/projects/private-content/ * Author: Aldo Latino * Author URI: https://www.aldolat.it/ - * Version: 6.3 + * Version: 6.3.1 * License: GPLv3 or later * Text Domain: private-content * Domain Path: /languages/ diff --git a/readme.txt b/readme.txt index 1e6d24c..30f0daf 100755 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: aldolat, specialk, thewanderingbrit Donate link: https://dev.aldolat.it/projects/private-content/ Tags: content, private, shortcode Requires at least: 3.0 -Tested up to: 5.5 -Stable tag: 6.3 +Tested up to: 5.6 +Stable tag: 6.3.1 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html