~canonical-sysadmins/wordpress/5.0

« back to all changes in this revision

Viewing changes to wp-admin/privacy.php

  • Committer: Barry Price
  • Date: 2018-07-06 10:05:47 UTC
  • mto: This revision was merged to the branch mainline in revision 40.
  • Revision ID: barry.price@canonical.com-20180706100547-hhm1a1chqcb32bpm
new upstream release 4.9.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
                $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
23
23
                update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
24
24
 
 
25
                $privacy_page_updated_message = __( 'Privacy policy page updated successfully.' );
 
26
 
 
27
                if ( $privacy_policy_page_id ) {
 
28
                        /*
 
29
                         * Don't always link to the menu customizer:
 
30
                         *
 
31
                         * - Unpublished pages can't be selected by default.
 
32
                         * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.
 
33
                         * - Themes might not "officially" support menus.
 
34
                         */
 
35
                        if (
 
36
                                'publish' === get_post_status( $privacy_policy_page_id )
 
37
                                && current_user_can( 'edit_theme_options' )
 
38
                                && current_theme_supports( 'menus' )
 
39
                        ) {
 
40
                                $privacy_page_updated_message = sprintf(
 
41
                                        /* translators: %s: URL to Customizer -> Menus */
 
42
                                        __( 'Privacy policy page updated successfully. Remember to <a href="%s">update your menus</a>!' ),
 
43
                                        esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )
 
44
                                );
 
45
                        }
 
46
                }
 
47
 
25
48
                add_settings_error(
26
49
                        'page_for_privacy_policy',
27
50
                        'page_for_privacy_policy',
28
 
                        sprintf(
29
 
                                /* translators: %s: URL to Customizer -> Menus */
30
 
                                __( 'Privacy policy page updated successfully. Remember to <a href="%s">update your menus</a>!' ),
31
 
                                'customize.php?autofocus[panel]=nav_menus'
32
 
                        ),
 
51
                        $privacy_page_updated_message,
33
52
                        'updated'
34
53
                );
35
54
        } elseif ( 'create-privacy-page' === $action ) {