WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 10 days ago

Last modified 9 days ago

#44967 closed enhancement (maybelater)

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

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

Description (last modified by garrett-eclipse)

Hello,

There's been several mentions of Drafts being available to the Privacy Policy page selector. I understand why they're there (reason - https://core.trac.wordpress.org/ticket/44356#comment:4), 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 - https://github.com/WordPress/WordPress/blob/4.9.8/wp-admin/privacy.php#L198-L207 wp_dropdown_pages call - https://github.com/WordPress/WordPress/blob/4.9.8/wp-admin/privacy.php#L214-L222

This will enable users to remove drafts from the select.

Thanks

Attachments (1)

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

Download all attachments as: .zip

Change History (10)

#1 @garrett-eclipse
4 months ago

  • Description modified (diff)

Updated URLs to permalinks.

@garrett-eclipse
4 months ago

Adds filter for privacy_policy_page_supported_post_stati and replaced existing arrays.

#2 @garrett-eclipse
4 months 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 4 months ago by garrett-eclipse (previous) (diff)

#3 @garrett-eclipse
3 months ago

  • Milestone changed from Awaiting Review to 5.1

#4 @pento
12 days 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
11 days ago

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

#6 @garrett-eclipse
11 days 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;
https://wordpress.slack.com/archives/C9695RJBW/p1537375887000100
https://wordpress.slack.com/archives/C9695RJBW/p1528309415000401
https://wordpress.slack.com/archives/C9695RJBW/p1528310339000291
https://wordpress.slack.com/archives/C9695RJBW/p1525918677000167

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
10 days 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
9 days 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.


9 days ago

Note: See TracTickets for help on using tickets.