mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 13:41:24 +01:00
Privacy: make creating a privacy policy page on install multisite compatible.
See #43491. Built from https://develop.svn.wordpress.org/trunk@43243 git-svn-id: http://core.svn.wordpress.org/trunk@43072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c5a527d96
commit
1b1cc0b371
@ -308,42 +308,50 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Privacy Policy page
|
// Privacy Policy page
|
||||||
if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
|
if ( is_multisite() ) {
|
||||||
include_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
$privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();
|
if ( ! empty( $privacy_policy_content ) ) {
|
||||||
$privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
|
$privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
|
||||||
|
|
||||||
$wpdb->insert(
|
$wpdb->insert(
|
||||||
$wpdb->posts, array(
|
$wpdb->posts, array(
|
||||||
'post_author' => $user_id,
|
'post_author' => $user_id,
|
||||||
'post_date' => $now,
|
'post_date' => $now,
|
||||||
'post_date_gmt' => $now_gmt,
|
'post_date_gmt' => $now_gmt,
|
||||||
'post_content' => $privacy_policy_content,
|
'post_content' => $privacy_policy_content,
|
||||||
'post_excerpt' => '',
|
'post_excerpt' => '',
|
||||||
'comment_status' => 'closed',
|
'comment_status' => 'closed',
|
||||||
'post_title' => __( 'Privacy Policy' ),
|
'post_title' => __( 'Privacy Policy' ),
|
||||||
/* translators: Privacy Policy page slug */
|
/* translators: Privacy Policy page slug */
|
||||||
'post_name' => __( 'privacy-policy' ),
|
'post_name' => __( 'privacy-policy' ),
|
||||||
'post_modified' => $now,
|
'post_modified' => $now,
|
||||||
'post_modified_gmt' => $now_gmt,
|
'post_modified_gmt' => $now_gmt,
|
||||||
'guid' => $privacy_policy_guid,
|
'guid' => $privacy_policy_guid,
|
||||||
'post_type' => 'page',
|
'post_type' => 'page',
|
||||||
'post_status' => 'draft',
|
'post_status' => 'draft',
|
||||||
'to_ping' => '',
|
'to_ping' => '',
|
||||||
'pinged' => '',
|
'pinged' => '',
|
||||||
'post_content_filtered' => '',
|
'post_content_filtered' => '',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$wpdb->insert(
|
$wpdb->insert(
|
||||||
$wpdb->postmeta, array(
|
$wpdb->postmeta, array(
|
||||||
'post_id' => 3,
|
'post_id' => 3,
|
||||||
'meta_key' => '_wp_page_template',
|
'meta_key' => '_wp_page_template',
|
||||||
'meta_value' => 'default',
|
'meta_value' => 'default',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
update_option( 'wp_page_for_privacy_policy', 3 );
|
update_option( 'wp_page_for_privacy_policy', 3 );
|
||||||
|
}
|
||||||
|
|
||||||
// Set up default widgets for default theme.
|
// Set up default widgets for default theme.
|
||||||
update_option(
|
update_option(
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-43242';
|
$wp_version = '5.0-alpha-43243';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user