From 467142de1be79bae0b5eb9bbbeff713ccb8ef763 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 27 May 2021 12:15:00 -0400 Subject: [PATCH 1/6] Links to posts with custom privacy are changed to preview links Fixes #852 --- common/php/class-module.php | 6 ++++++ modules/custom-status/custom-status.php | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/php/class-module.php b/common/php/class-module.php index 59da890d2..988d60572 100644 --- a/common/php/class-module.php +++ b/common/php/class-module.php @@ -62,6 +62,12 @@ public function __construct() $this->twig->addExtension(new Twig_Extension_Debug()); } } + + foreach(get_post_stati(['public' => true, 'private' => true], 'names', 'OR') as $status) { + if (!in_array($status, $this->published_statuses)) { + $this->published_statuses []= $status; + } + } } /** diff --git a/modules/custom-status/custom-status.php b/modules/custom-status/custom-status.php index 2818d6fe7..fcda4eac1 100644 --- a/modules/custom-status/custom-status.php +++ b/modules/custom-status/custom-status.php @@ -2215,9 +2215,11 @@ public function fix_preview_link_part_two($permalink, $post, $sample = false) } //Is this published? - if (in_array($post->post_status, $this->published_statuses)) { - return $permalink; - } + if ($status_obj = get_post_status_object($post->post_status)) { + if (!empty($status_obj->public) || !empty($status_obj->private)) { + return $permalink; + } + } //Are we overriding the permalink? Don't do anything if (isset($_POST['action']) && $_POST['action'] == 'sample-permalink') { From 0b6e1839ba5aeeb6744469b7ddbe81019ab21f4d Mon Sep 17 00:00:00 2001 From: Anderson Grudtner Martins Date: Fri, 28 May 2021 16:33:18 -0300 Subject: [PATCH 2/6] Fix label for the Post Status taxonomy, #846 --- modules/custom-status/custom-status.php | 2 +- readme.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/custom-status/custom-status.php b/modules/custom-status/custom-status.php index 2818d6fe7..40f142a37 100644 --- a/modules/custom-status/custom-status.php +++ b/modules/custom-status/custom-status.php @@ -299,7 +299,7 @@ public function register_custom_statuses($args = []) [ 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', - 'label' => false, + 'label' => __('Statuses', 'publishpress'), 'query_var' => false, 'rewrite' => false, 'show_ui' => false, diff --git a/readme.txt b/readme.txt index 48fbed9e3..22e827913 100644 --- a/readme.txt +++ b/readme.txt @@ -120,6 +120,10 @@ Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitt The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). += UNRELEASED = + +* Fixed: Fix "Statuses" doesn't appear with a title in important areas, #846; + = [3.3.2] - 2021-05-27 = * Fixed: Fix the icons for statuses, #841; From 280b3830488f632fad86909f50ad069f486b2fc5 Mon Sep 17 00:00:00 2001 From: Anderson Grudtner Martins Date: Tue, 15 Jun 2021 16:39:15 -0300 Subject: [PATCH 3/6] Update the changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 22e827913..f044fc7d7 100644 --- a/readme.txt +++ b/readme.txt @@ -123,6 +123,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). = UNRELEASED = * Fixed: Fix "Statuses" doesn't appear with a title in important areas, #846; +* Fixed: Fix links to posts with custom privacy are changed to preview links, #852; = [3.3.2] - 2021-05-27 = From 73914c1c739b2e6651eba4aaf7bf3b396d40d287 Mon Sep 17 00:00:00 2001 From: Anderson Grudtner Martins Date: Tue, 15 Jun 2021 19:49:55 -0300 Subject: [PATCH 4/6] Bump version number --- includes.php | 2 +- publishpress.php | 2 +- readme.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes.php b/includes.php index 33e26ce69..dbe08c7ca 100644 --- a/includes.php +++ b/includes.php @@ -33,7 +33,7 @@ if (!defined('PP_LOADED')) { // Define constants - define('PUBLISHPRESS_VERSION', '3.3.2'); + define('PUBLISHPRESS_VERSION', '3.3.3-rc.1'); define('PUBLISHPRESS_BASE_PATH', __DIR__); define('PUBLISHPRESS_FILE_PATH', PUBLISHPRESS_BASE_PATH . '/publishpress.php'); define('PUBLISHPRESS_LIBRARIES_PATH', PUBLISHPRESS_BASE_PATH . '/libraries'); diff --git a/publishpress.php b/publishpress.php index 0c0788dfe..764f89f70 100644 --- a/publishpress.php +++ b/publishpress.php @@ -5,7 +5,7 @@ * Description: PublishPress helps you plan and publish content with WordPress. Features include a content calendar, notifications, and custom statuses. * Author: PublishPress * Author URI: https://publishpress.com - * Version: 3.3.2 + * Version: 3.3.3-rc.1 * Text Domain: publishpress * Domain Path: /languages * diff --git a/readme.txt b/readme.txt index f044fc7d7..5273f8587 100644 --- a/readme.txt +++ b/readme.txt @@ -120,7 +120,7 @@ Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitt The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -= UNRELEASED = += [3.3.3] - UNRELEASED = * Fixed: Fix "Statuses" doesn't appear with a title in important areas, #846; * Fixed: Fix links to posts with custom privacy are changed to preview links, #852; From fa54ade4aa510e73e8119de32860583f45baed53 Mon Sep 17 00:00:00 2001 From: Anderson Grudtner Martins Date: Wed, 16 Jun 2021 10:36:21 -0300 Subject: [PATCH 5/6] Update version number --- includes.php | 2 +- publishpress.php | 2 +- readme.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes.php b/includes.php index dbe08c7ca..3b334815b 100644 --- a/includes.php +++ b/includes.php @@ -33,7 +33,7 @@ if (!defined('PP_LOADED')) { // Define constants - define('PUBLISHPRESS_VERSION', '3.3.3-rc.1'); + define('PUBLISHPRESS_VERSION', '3.3.3'); define('PUBLISHPRESS_BASE_PATH', __DIR__); define('PUBLISHPRESS_FILE_PATH', PUBLISHPRESS_BASE_PATH . '/publishpress.php'); define('PUBLISHPRESS_LIBRARIES_PATH', PUBLISHPRESS_BASE_PATH . '/libraries'); diff --git a/publishpress.php b/publishpress.php index 764f89f70..576f665cc 100644 --- a/publishpress.php +++ b/publishpress.php @@ -5,7 +5,7 @@ * Description: PublishPress helps you plan and publish content with WordPress. Features include a content calendar, notifications, and custom statuses. * Author: PublishPress * Author URI: https://publishpress.com - * Version: 3.3.3-rc.1 + * Version: 3.3.3 * Text Domain: publishpress * Domain Path: /languages * diff --git a/readme.txt b/readme.txt index 5273f8587..37019aade 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: editorial calendar, notifications, custom statuses, editorial comments, wo Requires at least: 4.6 Requires PHP: 5.6 Tested up to: 5.7 -Stable tag: 3.3.2 +Stable tag: 3.3.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From d8615f4d7e81515646b5bfa7f01e8efd04440cd7 Mon Sep 17 00:00:00 2001 From: Anderson Grudtner Martins Date: Wed, 16 Jun 2021 10:36:51 -0300 Subject: [PATCH 6/6] Update the version number --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 37019aade..8026bc00e 100644 --- a/readme.txt +++ b/readme.txt @@ -120,7 +120,7 @@ Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitt The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -= [3.3.3] - UNRELEASED = += [3.3.3] - 2021-06-16 = * Fixed: Fix "Statuses" doesn't appear with a title in important areas, #846; * Fixed: Fix links to posts with custom privacy are changed to preview links, #852;