[wp-trac] [WordPress Trac] #46255: "Need help putting together your new Privacy Policy page?" notice always shown if Privacy Policy is the first page created

WordPress Trac noreply at wordpress.org
Thu Feb 14 14:37:19 UTC 2019


#46255: "Need help putting together your new Privacy Policy page?" notice always
shown if Privacy Policy is the first page created
----------------------------+-----------------------------
 Reporter:  filippo.toso    |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  5.0.3
 Severity:  minor           |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 Hi,

 if the first page returned by get_post('') is the Privacy Policy page, the
 "Need help putting together your new Privacy Policy page?" notice will be
 always shown.

 This happens due to the following row in
 WP_Privacy_Policy_Content::notice():

 {{{
 $post = get_post( $post );
 }}}

 This method is called by admin_notices action without parameters. This
 means that get_post returns the first post. If this post is the Privacy
 Policy, the notice will be always shown. I suggest adding the following
 check at the beginning of the method:

 {{{
 if ( ! $post ) {
     return;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46255>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list