Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44413 closed defect (bug) (invalid)

Privacy policy page select is not up-to-date if the options is setted in another than using the select in wp-admin/privacy.php

Reported by: f2cmb's profile f2cmb Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Privacy Keywords:
Focuses: Cc:

Description

When registering a privacy policy page or custom post, via 'update_options()' or directly in database via putting a post ID in the 'wp_page_for_privacy_policy' in 'wp_options', the given post is effectively registered as the privacy policy page (for example the link is in the action confirmation mail sent to user), but if i open wp-admin/privacy.php page, the select field is displayed empty.

Attachments (2)

Change History (6)

#1 follow-up: @subrataemfluence
6 years ago

Would you please mind to describe the exact steps to reproduce the issue?
Thank you!

#2 in reply to: ↑ 1 @f2cmb
6 years ago

Replying to subrataemfluence:

Would you please mind to describe the exact steps to reproduce the issue?
Thank you!

Hello there !

After updating the post ID, via an update_option(), or directly in the wp_options field, the select stays empty. Here is the way i do it in my plugin (assuming the post with this slug exist) :

<?php
//set the regular policy page in wp-admin privacy.php

function register_policy_post() {
    $post = get_page_by_path('politique-de-confidentialite', OBJECT, 'page-systeme');
    if ( $post ) {
        update_option( 'wp_page_for_privacy_policy', $post->ID );
    }
}

Only the choice made in wp-admin/privacy.php is displayed, even if the post selected is a regular page. I guess a patch would be not to loop for populating the dropdown through all existing posts, but at least display the one registered in the option field in database.

Best regards.

Last edited 6 years ago by f2cmb (previous) (diff)

#3 follow-up: @garrett-eclipse
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @f2cmb after testing the issue on trunk I'm not seeing a problem, at least with the latest build. Updating wp_page_for_privacy_policy in the database and reloading the Privacy settings I see the updated page set. Also going from no option and adding it went from an unset select to the specified page. As such I'm going to close as invalid. If you can reproduce please feel free to re-open. It may be you're experiencing a caching issue, do you have the wp-admin cached?

#4 in reply to: ↑ 3 @f2cmb
6 years ago

Replying to garrett-eclipse:

Hi @f2cmb after testing the issue on trunk I'm not seeing a problem, at least with the latest build. Updating wp_page_for_privacy_policy in the database and reloading the Privacy settings I see the updated page set. Also going from no option and adding it went from an unset select to the specified page. As such I'm going to close as invalid. If you can reproduce please feel free to re-open. It may be you're experiencing a caching issue, do you have the wp-admin cached?

Hi @garrett-eclipse i'll take a look as soon as i can. I can already answer you that i made the test without any cache.

Note: See TracTickets for help on using tickets.