WordPress.org

Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#44202 closed enhancement (invalid)

Link to "Privacy Policy" automatically added to footer of any Twenty XXX theme

Reported by: Ov3rfly Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.6
Component: Bundled Theme Keywords: gdpr dev-feedback
Focuses: privacy Cc:

Description

Clients are confused about "weird links appearing on each and every page" and are "scared about SEO ranking as the link does not have a nofollow" ... quotes from client and their SEO consultant.

They already have own privacy policy links in footer via do_action( 'twentyXXX_credits' ); or in custom menus via wp_footer().

Expected Behaviour: No forced output of any links. Maybe a switch in the exact same place where the privacy policy page is set. Switch should be opt-in like "add link to footer, some themes may show it", not an opt-out.

A dev note for theme authors is mentioned in a related ticket, can somebody provide a link to this dev note?

Besides that, the link does not show the real title of the privacy policy page, maybe related: #44192

Personal rant: You can't simply add breaking changes to frontend with a minor update from 4.9.5 to 4.9.6. WordPress is not a nanny, it is the users own responsibility to add links, when and where they like. Current behaviour is not "democratize publishing", it is "dictate publishing".

Attachments (4)

visibility-opt-in-checkbox-added.png (10.6 KB) - added by subrataemfluence 4 weeks ago.
Checkbox added for Privacy Policy link visibility in footer opt-in
privacy.diff (1.6 KB) - added by subrataemfluence 4 weeks ago.
Proposed patch for wp-admin/privacy.php
link-template.diff (522 bytes) - added by subrataemfluence 4 weeks ago.
Proposed patch for modified get_the_privacy_policy_link function
privacy-2.diff (1.6 KB) - added by subrataemfluence 4 weeks ago.
Changed checkbox label to "Show Privacy Policy link automatically." from "Show Privacy link in site footer"

Download all attachments as: .zip

Change History (13)

#1 in reply to: ↑ description @SergeyBiryukov
4 weeks ago

  • Component changed from Privacy to Bundled Theme
  • Focuses privacy added

Introduced in [43051].

Replying to Ov3rfly:

A dev note for theme authors is mentioned in a related ticket, can somebody provide a link to this dev note?

See https://make.wordpress.org/core/2018/05/17/changes-that-affect-theme-authors-in-wordpress-4-9-6/.

@subrataemfluence
4 weeks ago

Checkbox added for Privacy Policy link visibility in footer opt-in

@subrataemfluence
4 weeks ago

Proposed patch for wp-admin/privacy.php

@subrataemfluence
4 weeks ago

Proposed patch for modified get_the_privacy_policy_link function

#2 @subrataemfluence
4 weeks ago

  • Component changed from Bundled Theme to Privacy
  • Keywords has-patch dev-feedback added
  • Summary changed from Link to "Privacy Policy" automagically added to footer of any Twenty XXX theme to Link to "Privacy Policy" automatically added to footer of any Twenty XXX theme
  • Type changed from defect (bug) to enhancement

I have proposed two patches to rectify automatic appearance of Privacy Policy link.

The function get_the_privacy_policy_link() in wp-includes/link-template.php will now check if the option wp_privacy_policy_footer_link_visibility has a value 1 in wp_options table. If yes, the link will appear.

However, since this behavior of displaying Privacy Policy does not block any core functional flow I have changed the type from Defect to Enhancement.

Also, hence newly implemented function get_the_privacy_policy_link() is directly related to Privacy and could be used in any theme, I have changed the component from Bundled Theme to Privacy. Please correct me if I am not right.

Please let me know if those work.

@subrataemfluence
4 weeks ago

Changed checkbox label to "Show Privacy Policy link automatically." from "Show Privacy link in site footer"

This ticket was mentioned in Slack in #gdpr-compliance by xkon. View the logs.


4 weeks ago

This ticket was mentioned in Slack in #core by iandunn. View the logs.


4 weeks ago

#5 follow-up: @Clorith
4 weeks ago

  • Component changed from Privacy to Bundled Theme

I had a look at the patches, and they actually introduce a few problems.

In link-template.diff your setting makes it so plugins and themes can't use the function any more if a setting isn't checked, it's a helper function made to return a formatted link and if one exists that should remain to be true.

In privacy-2.diff What if my theme doesn't offer the user a choice, or I don't provide a fixed footer location, then this checkbox setting ends up being misleading to the user.

If anything, fixes should be applied to the themes them selves, and not core.

For the sake of having it noted, a case could be made for bundled themes providing sane defaults for the average user, and as such this should be included automatically for them to reduce the burden on the user.

#6 @knutsp
4 weeks ago

As @Clorith says, this is not a core issue. It was introduced in the themes and must be fixed there.

#7 in reply to: ↑ 5 @subrataemfluence
4 weeks ago

Replying to Clorith:

I understand your point.

However, what option the admin has if he wants to remove / hide the link without contacting the developer? The checkbox will give the ability to control the visibility of the link I believe.

In link-template.diff your setting makes it so plugins and themes can't use the function any more if a setting isn't checked, it's a helper function made to return a formatted link and if one exists that should remain to be true.

We can perhaps add this element in $core_options array and set the value to 1 so that the checkbox remains checked by default and the link will appear if the function is called somewhere. If this could be done, I believe plugins and themes can easily use the function. And when admin wants he can easily turn it off by unchecking the checkbox.

In privacy-2.diff What if my theme doesn't offer the user a choice, or I don't provide a fixed footer location, then this checkbox setting ends up being misleading to the user.

This is why I changed the label so that it does not say "footer".

I may be conceptually wrong but thought it might add to the usability for a site admin to control the visibility of this link.

#8 @pento
4 weeks ago

  • Keywords has-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The default themes are built to show how to use various theme functionalities, in this case, they're correctly showing how to use the the_privacy_policy_link() template tag.

For custom themes, you can choose to not use this template tag. If you're unable to customise your theme in this way, then you can add a small plugin to remove the link:

<?php
add_filter( 'the_privacy_policy_link', '__return_empty_string' );

#9 @Ov3rfly
4 weeks ago

Thanks for your advise, we now have rolled out this plugin to a number of sites which are based on default Twenty XXX themes.

<?php
/*
Plugin Name: Remove "Privacy Policy" in Twenty XXX footer
Description: Removes the "Privacy Policy" automatically added to footer of any Twenty XXX theme, https://core.trac.wordpress.org/ticket/44202#comment:8
Version: 1.0
Author: Gary Pendergast 
Author URI: https://profiles.wordpress.org/pento
*/
add_filter( 'the_privacy_policy_link', '__return_empty_string' );

It is pretty effective, the "Privacy Policy" link in WordPress core login and registration pages is now gone as well.

Seems that the current implementation to show theme functionalities like adding a privacy policy link in default themes is not consistent to usual implementation, with own functions and filters using a twentyXXX_ prefix, like twentyseventeen_get_svg(), twentyseventeen_is_frontpage(), all the way back to twentyten_continue_reading_link(), etc.

Note: See TracTickets for help on using tickets.