Opened 4 years ago
Closed 4 years ago
#52194 closed enhancement (invalid)
Add filter to disable or amend the "Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme." notice
Reported by: | ninetyninew | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Privacy | Keywords: | |
Focuses: | administration | Cc: |
Description
On an assigned privacy policy page a notice appears when editing the page:
"Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme." with a link to a privacy policy guide.
It would be useful to have a filter here to completely remove or amend the text in this message, as this links to WordPress's own privacy policy guide.
If you are building a website for a client you may want to hide this or provide your own privacy policy instructions which aren't WordPress's.
Change History (4)
#3
follow-up:
↓ 4
@
4 years ago
Thanks @garrett-eclipse, I wanted to just remove it completely so this works for me, the only concern would be if the action name was changed for any reason later...?
#4
in reply to:
↑ 3
@
4 years ago
- Keywords close removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Version 5.6 deleted
Replying to ninetyninew:
Thanks @garrett-eclipse, I wanted to just remove it completely so this works for me, the only concern would be if the action name was changed for any reason later...?
Glad to hear. The admin_notices action is unlikely to change anytime soon, but any of those changes would be made with back-compat in mind so you shouldn't see a fatal in future.
Going to close this.
Hi @ninetyninew I hope this finds you well. The privacy notice you mentioned is hooked into admin_notices as the WP_Privacy_Policy_Content::notice() function, you can already unhook it to remove by adding the following to your functions.php;
remove_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );
If you'd rather replace it than along with the above removal, add in your own notice as follows;
Note: I just duplicated the WP_Privacy_Policy_Content::notice() function for the above customization, I'd suggest going directly to the latest version below in case it changes from the time of me writing this.
Reference - https://github.com/WordPress/wordpress-develop/blob/aac637dcdc690050f51cc7cb20f1230bafe4a98d/src/wp-admin/includes/class-wp-privacy-policy-content.php#L300-L367
Do note, it's a longer function as it is handling both Classic Editor and Block Editor interfaces.
Marking as close since it's already possible to achieve the goal with the existing hook. Leaving open for now if someone has a good reason an additional filter would be beneficial beyond the hook we already have.