Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#44967 closed enhancement (maybelater)

Add status filter to allow suppression of drafts from Privacy Policy select

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: garrett-eclipse's profile garrett-eclipse
Milestone: Priority: normal
Severity: normal Version: 4.9.8
Component: Privacy Keywords: has-patch
Focuses: Cc:

Description (last modified by garrett-eclipse)


There's been several mentions of Drafts being available to the Privacy Policy page selector. I understand why they're there (reason -, but it would be nice to enable admins to filter out drafts if they so desire.

So am proposing a variable privacy_policy_page_supported_post_stati which by default is set to array( 'publish', 'draft' ) and is put through a filter and then used in both the $has_pages check and the wp_dropdown_pages call.
$has_pages check -
wp_dropdown_pages call -

This will enable users to remove drafts from the select.


Attachments (1)

44967.diff (1.2 KB) - added by garrett-eclipse 6 years ago.
Adds filter for privacy_policy_page_supported_post_stati and replaced existing arrays.

Download all attachments as: .zip

Change History (11)

#1 @garrett-eclipse
6 years ago

  • Description modified (diff)

Updated URLs to permalinks.

6 years ago

Adds filter for privacy_policy_page_supported_post_stati and replaced existing arrays.

#2 @garrett-eclipse
6 years ago

  • Keywords has-patch added
  • Owner set to garrett-eclipse
  • Status changed from new to assigned
  • Version set to 4.9.8

I've implemented a new variable $privacy_policy_page_supported_post_stati and filter of the same name which defaults to an array of 'draft' and 'publish'. This enables admins to suppress 'drafts' among other uses.

Last edited 6 years ago by garrett-eclipse (previous) (diff)

#3 @garrett-eclipse
6 years ago

  • Milestone changed from Awaiting Review to 5.1

#4 @pento
6 years ago

Has there been any request for this filter? It seems like an extremely niche case, if there's any demand at all.

#5 @pento
6 years ago

  • Keywords reporter-feedback close added
  • Milestone changed from 5.1 to Future Release

#6 @garrett-eclipse
6 years ago

  • Keywords dev-feedback added; reporter-feedback close removed

Hi @pento

Yes it is niche for sure, and no public outcry for it, more just confusion from developers and some issues that arose due to the inclusion of drafts in the dropdown.

Had setup the ticket as there was several times in trac and slack where it had been raised as possibly confusing to provide the drafts, and it has also been raised due to the ability to select drafts that the email was generating an empty url.

The issue with drafts causing get_privacy_policy_url to return empty thus leaving the generated email with a broken link is being addressed in #44356, this was my primary motive for this filter idea to allow admins to avoid the selection of drafts.

Relevant tickets;
#44356 - drafts cause broken url in generated email
#44100 - cleared up confusion in the dropdown by adding (draft)
#44131 - due to drafts being available verbiage change was required

As well some slack conversations indicating confusion;

Let me know if I can provide any further information and if you feel it too niche happy to revisit maybelater if there becomes public demand.

#7 @pento
6 years ago

  • Keywords dev-feedback removed
  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from assigned to closed

Thanks for the context, @garrett-eclipse. I think it's a bit too niche, but we can always revisit it if there turns out to be future demand.

#8 @garrett-eclipse
6 years ago

Thanks @pento I appreciate the review and tend to agree it's fairly niche. Going to post a last call to #core-privacy just in case anyone has a direct need for it.

This ticket was mentioned in Slack in #core-privacy by garrett-eclipse. View the logs.

6 years ago

#10 @garrett-eclipse
4 years ago

  • Focuses privacy removed

Dropping privacy focus as it's already in the Privacy component.

Note: See TracTickets for help on using tickets.