Privacy: automatically create a Privacy Policy page when installing WordPress.

Props fclaussen, azaozz.
Merges [42981], [42982], [43243] to the 4.9 branch.
Fixes #43491.
Built from https://develop.svn.wordpress.org/branches/4.9@43272


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-05-15 15:30:26 +00:00
parent 10c9d391a8
commit 9438733d24
2 changed files with 47 additions and 1 deletions

View File

@ -252,6 +252,52 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
));
$wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );
// Privacy Policy page
if ( is_multisite() ) {
// Disable by default unless the suggested content is provided.
$privacy_policy_content = get_site_option( 'default_privacy_policy_content' );
} else {
if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
include_once( ABSPATH . 'wp-admin/includes/misc.php' );
}
$privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();
}
if ( ! empty( $privacy_policy_content ) ) {
$privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
$wpdb->insert(
$wpdb->posts, array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
'post_content' => $privacy_policy_content,
'post_excerpt' => '',
'comment_status' => 'closed',
'post_title' => __( 'Privacy Policy' ),
/* translators: Privacy Policy page slug */
'post_name' => __( 'privacy-policy' ),
'post_modified' => $now,
'post_modified_gmt' => $now_gmt,
'guid' => $privacy_policy_guid,
'post_type' => 'page',
'post_status' => 'draft',
'to_ping' => '',
'pinged' => '',
'post_content_filtered' => '',
)
);
$wpdb->insert(
$wpdb->postmeta, array(
'post_id' => 3,
'meta_key' => '_wp_page_template',
'meta_value' => 'default',
)
);
update_option( 'wp_page_for_privacy_policy', 3 );
}
// Set up default widgets for default theme.
update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
update_option( 'widget_recent-posts', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.6-RC1-43271';
$wp_version = '4.9.6-RC1-43272';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.