Make WordPress Core

Ticket #43491: 43491.patch

File 43491.patch, 1.7 KB (added by azaozz, 7 years ago)
  • src/wp-admin/includes/upgrade.php

     
    307307                        )
    308308                );
    309309
     310                // Privacy Policy page
     311                if ( is_multisite() ) {
     312                        $privacy_policy_content = get_site_option( 'privacy_policy_page_default_content' );
     313                }
     314
     315                $privacy_policy_content = ! empty( $privacy_policy_content ) ? $privacy_policy_content :
     316                        __( '(Replace this text with the content of your privacy policy, then publish this page.)' );
     317
     318                $privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
     319                $wpdb->insert(
     320                        $wpdb->posts, array(
     321                                'post_author'           => $user_id,
     322                                'post_date'             => $now,
     323                                'post_date_gmt'         => $now_gmt,
     324                                'post_content'          => $privacy_policy_content,
     325                                'post_excerpt'          => '',
     326                                'comment_status'        => 'closed',
     327                                'post_title'            => __( 'Privacy Policy' ),
     328                                /* translators: Privacy Policy page slug */
     329                                'post_name'             => __( 'privacy-policy' ),
     330                                'post_modified'         => $now,
     331                                'post_modified_gmt'     => $now_gmt,
     332                                'guid'                  => $privacy_policy_guid,
     333                                'post_type'             => 'page',
     334                                'post_status'           => 'draft',
     335                                'to_ping'               => '',
     336                                'pinged'                => '',
     337                                'post_content_filtered' => '',
     338                        )
     339                );
     340                $wpdb->insert(
     341                        $wpdb->postmeta, array(
     342                                'post_id'    => 3,
     343                                'meta_key'   => '_wp_page_template',
     344                                'meta_value' => 'default',
     345                        )
     346                );
     347                update_option( 'wp_page_for_privacy_policy', 3 );
     348
    310349                // Set up default widgets for default theme.
    311350                update_option(
    312351                        'widget_search', array(