Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#46958 closed defect (bug) (fixed)

Which of 'privacypolicy' or 'privacy_policy' is valid for get_query_template function?

Reported by: tmatsuur's profile tmatsuur Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Privacy Keywords:
Focuses: template Cc:


Currently, 'privacy_policy' is used in the get_privacy_policy_template function.

return get_query_template( 'privacy_policy', $templates );

In contrast, the docs contains a 'privacypolicy' without the hyphen.

Is the content of docs wrong?

Change History (6)

#1 @tmatsuur
4 years ago

It was an underscore, not a hyphen.

#2 follow-up: @johnbillion
4 years ago

  • Component changed from General to Privacy
  • Focuses template added
  • Milestone changed from Awaiting Review to 5.2

This sounds like the same problem that happens with front_page.

#3 in reply to: ↑ 2 @tmatsuur
4 years ago

Replying to johnbillion:

This sounds like the same problem that happens with front_page.

Thank you @johnbillion.

#4 @johnbillion
4 years ago

This template was introduced in #44005.

Related issue for the underscore being stripped out: #21213.

Let's standardise on using either privacypolicy or privacy.

#5 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45231:

Themes: Standardize on passing frontpage and privacypolicy as the $type parameter to get_query_template().

These keys are used in {$type}_template_hierarchy and {$type}_template filters.

Previously, front_page and privacy_policy were passed, but get_query_template() stripped the underscores before passing the values to the filters.

Props rinatkhaziev, tmatsuur, johnbillion.
Fixes #21213, #46958.

#6 @garrett-eclipse
4 years ago

Thanks for catching this @tmatsuur and identifying the issue @johnbillion I'd copied the front_page implementation for #44005 and overlooked there was a pre-existing issue with that.
I appreciate the quick turnaround and patch @SergeyBiryukov
All the best

Note: See TracTickets for help on using tickets.