WordPress.org

Make WordPress Core

Changeset 44168


Ignore:
Timestamp:
12/14/2018 05:42:20 AM (19 months ago)
Author:
pento
Message:

Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.

Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/misc.php

    r43638 r44168  
    906906
    907907/**
     908 *
    908909 * @global array $_wp_admin_css_colors
    909910 */
     
    14231424     */
    14241425    public static function policy_text_changed_notice() {
     1426        global $post;
     1427
    14251428        $screen = get_current_screen()->id;
    14261429
     
    14301433
    14311434        ?>
    1432         <div class="policy-text-updated notice notice-warning">
     1435        <div class="policy-text-updated notice notice-warning is-dismissible">
    14331436            <p>
    14341437            <?php
     
    17261729     *
    17271730     * @since 4.9.6
    1728      *
    1729      * @param bool $descr Whether to include the descriptions under the section headings. Default false.
     1731     * @since 5.0.0 Added the `$blocks` parameter.
     1732     *
     1733     * @param bool $description Whether to include the descriptions under the section headings. Default false.
     1734     * @param bool $blocks      Whether to format the content for the block editor. Default true.
    17301735     * @return string The default policy content.
    17311736     */
    1732     public static function get_default_content( $descr = false ) {
    1733         $suggested_text = $descr ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
     1737    public static function get_default_content( $description = false, $blocks = true ) {
     1738        $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
    17341739        $content        = '';
     1740        $strings        = array();
    17351741
    17361742        // Start of the suggested privacy policy text.
    1737         $descr && $content .=
    1738             '<div class="wp-suggested-text">';
    1739         $content           .=
    1740             '<h2>' . __( 'Who we are' ) . '</h2>';
    1741         $descr && $content .=
    1742             '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>' .
    1743             '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
    1744         $content           .=
    1745             /* translators: %s Site URL */
    1746             '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>' .
    1747 
    1748             '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
    1749         $descr && $content .=
    1750             '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>' .
    1751             '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>' .
    1752             '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>' .
    1753             '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>' .
    1754             '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
    1755 
    1756         $content           .=
    1757             '<h3>' . __( 'Comments' ) . '</h3>';
    1758         $descr && $content .=
    1759             '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
    1760         $content           .=
    1761             '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>' .
    1762             '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>' .
    1763 
    1764             '<h3>' . __( 'Media' ) . '</h3>';
    1765         $descr && $content .=
    1766             '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
    1767         $content           .=
    1768             '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>' .
    1769 
    1770             '<h3>' . __( 'Contact forms' ) . '</h3>';
    1771         $descr && $content .=
    1772             '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
    1773 
    1774         $content           .=
    1775             '<h3>' . __( 'Cookies' ) . '</h3>';
    1776         $descr && $content .=
    1777             '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
    1778         $content           .=
    1779             '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>' .
    1780             '<p>' . __( 'If you have an account and you log in to this site, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>' .
    1781             '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>' .
    1782             '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>' .
    1783 
    1784             '<h3>' . __( 'Embedded content from other websites' ) . '</h3>' .
    1785             '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>' .
    1786             '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>' .
    1787 
    1788             '<h3>' . __( 'Analytics' ) . '</h3>';
    1789         $descr && $content .=
    1790             '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>' .
    1791             '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
    1792 
    1793         $content           .=
    1794             '<h2>' . __( 'Who we share your data with' ) . '</h2>';
    1795         $descr && $content .=
    1796             '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>' .
    1797             '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
    1798 
    1799         $content           .=
    1800             '<h2>' . __( 'How long we retain your data' ) . '</h2>';
    1801         $descr && $content .=
    1802             '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
    1803         $content           .=
    1804             '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>' .
    1805             '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>' .
    1806 
    1807             '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
    1808         $descr && $content .=
    1809             '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
    1810         $content           .=
    1811             '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>' .
    1812 
    1813             '<h2>' . __( 'Where we send your data' ) . '</h2>';
    1814         $descr && $content .=
    1815             '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>' .
    1816             '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
    1817         $content           .=
    1818             '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>' .
    1819 
    1820             '<h2>' . __( 'Your contact information' ) . '</h2>';
    1821         $descr && $content .=
    1822             '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
    1823 
    1824         $content           .=
    1825             '<h2>' . __( 'Additional information' ) . '</h2>';
    1826         $descr && $content .=
    1827             '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
    1828 
    1829         $content           .=
    1830             '<h3>' . __( 'How we protect your data' ) . '</h3>';
    1831         $descr && $content .=
    1832             '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
    1833 
    1834         $content           .=
    1835             '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
    1836         $descr && $content .=
    1837             '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
    1838 
    1839         $content           .=
    1840             '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
    1841         $descr && $content .=
    1842             '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
    1843 
    1844         $content           .=
    1845             '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
    1846         $descr && $content .=
    1847             '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
    1848 
    1849         $content           .=
    1850             '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
    1851         $descr && $content .=
    1852             '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>' .
    1853             '</div>';
     1743        if ( $description ) {
     1744            $strings[] = '<div class="wp-suggested-text">';
     1745        }
     1746
     1747        /* translators: default privacy policy heading. */
     1748        $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';
     1749
     1750        if ( $description ) {
     1751            /* translators: privacy policy tutorial. */
     1752            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';
     1753            /* translators: privacy policy tutorial. */
     1754            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
     1755        }
     1756
     1757        /* translators: default privacy policy text, %s Site URL. */
     1758        $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
     1759
     1760        /* translators: default privacy policy heading. */
     1761        $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
     1762
     1763        if ( $description ) {
     1764            /* translators: privacy policy tutorial. */
     1765            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';
     1766            /* translators: privacy policy tutorial. */
     1767            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
     1768            /* translators: privacy policy tutorial. */
     1769            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>';
     1770            /* translators: privacy policy tutorial. */
     1771            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>';
     1772            /* translators: privacy policy tutorial. */
     1773            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
     1774        }
     1775
     1776        /* translators: default privacy policy heading. */
     1777        $strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
     1778
     1779        if ( $description ) {
     1780            /* translators: privacy policy tutorial. */
     1781            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
     1782        }
     1783
     1784        /* translators: default privacy policy text. */
     1785        $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
     1786        /* translators: default privacy policy text. */
     1787        $strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
     1788
     1789        /* translators: default privacy policy heading. */
     1790        $strings[] = '<h3>' . __( 'Media' ) . '</h3>';
     1791
     1792        if ( $description ) {
     1793            /* translators: privacy policy tutorial. */
     1794            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
     1795        }
     1796
     1797        /* translators: default privacy policy text. */
     1798        $strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
     1799
     1800        /* translators: default privacy policy heading. */
     1801        $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
     1802
     1803        if ( $description ) {
     1804            /* translators: privacy policy tutorial. */
     1805            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
     1806        }
     1807
     1808        /* translators: default privacy policy heading. */
     1809        $strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
     1810
     1811        if ( $description ) {
     1812            /* translators: privacy policy tutorial. */
     1813            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
     1814        }
     1815
     1816        /* translators: default privacy policy text. */
     1817        $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
     1818        /* translators: default privacy policy text. */
     1819        $strings[] = '<p>' . __( 'If you have an account and you log in to this site, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
     1820        /* translators: default privacy policy text. */
     1821        $strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
     1822        /* translators: default privacy policy text. */
     1823        $strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
     1824
     1825        /* translators: default privacy policy heading. */
     1826        $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
     1827        /* translators: default privacy policy text. */
     1828        $strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
     1829        /* translators: default privacy policy text. */
     1830        $strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
     1831
     1832        /* translators: default privacy policy heading. */
     1833        $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
     1834
     1835        if ( $description ) {
     1836            /* translators: privacy policy tutorial. */
     1837            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';
     1838            /* translators: privacy policy tutorial. */
     1839            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
     1840        }
     1841
     1842        /* translators: default privacy policy heading. */
     1843        $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
     1844
     1845        if ( $description ) {
     1846            /* translators: privacy policy tutorial. */
     1847            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';
     1848            /* translators: privacy policy tutorial. */
     1849            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
     1850        }
     1851
     1852        /* translators: default privacy policy heading. */
     1853        $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
     1854
     1855        if ( $description ) {
     1856            /* translators: privacy policy tutorial. */
     1857            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
     1858        }
     1859
     1860        /* translators: default privacy policy text. */
     1861        $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
     1862        /* translators: default privacy policy text. */
     1863        $strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
     1864
     1865        /* translators: default privacy policy heading. */
     1866        $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
     1867
     1868        if ( $description ) {
     1869            /* translators: privacy policy tutorial. */
     1870            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
     1871        }
     1872
     1873        /* translators: default privacy policy text. */
     1874        $strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
     1875
     1876        /* translators: default privacy policy heading. */
     1877        $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
     1878
     1879        if ( $description ) {
     1880            /* translators: privacy policy tutorial. */
     1881            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';
     1882            /* translators: privacy policy tutorial. */
     1883            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
     1884        }
     1885
     1886        /* translators: default privacy policy text. */
     1887        $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
     1888
     1889        /* translators: default privacy policy heading. */
     1890        $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
     1891
     1892        if ( $description ) {
     1893            /* translators: privacy policy tutorial. */
     1894            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
     1895        }
     1896
     1897        /* translators: default privacy policy heading. */
     1898        $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
     1899
     1900        if ( $description ) {
     1901            /* translators: privacy policy tutorial. */
     1902            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
     1903        }
     1904
     1905        /* translators: default privacy policy heading. */
     1906        $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
     1907
     1908        if ( $description ) {
     1909            /* translators: privacy policy tutorial. */
     1910            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
     1911        }
     1912
     1913        /* translators: default privacy policy heading. */
     1914        $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
     1915
     1916        if ( $description ) {
     1917            /* translators: privacy policy tutorial. */
     1918            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
     1919        }
     1920
     1921        /* translators: default privacy policy heading. */
     1922        $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
     1923
     1924        if ( $description ) {
     1925            /* translators: privacy policy tutorial. */
     1926            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
     1927        }
     1928
     1929        /* translators: default privacy policy heading. */
     1930        $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
     1931
     1932        if ( $description ) {
     1933            /* translators: privacy policy tutorial. */
     1934            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
     1935        }
     1936
     1937        /* translators: default privacy policy heading. */
     1938        $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
     1939
     1940        if ( $description ) {
     1941            /* translators: privacy policy tutorial. */
     1942            $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
     1943            $strings[] = '</div>';
     1944        }
     1945
     1946        if ( $blocks ) {
     1947            foreach ( $strings as $key => $string ) {
     1948                if ( 0 === strpos( $string, '<p>' ) ) {
     1949                    $strings[ $key ] = '<!-- wp:paragraph -->' . $string . '<!-- /wp:paragraph -->';
     1950                }
     1951
     1952                if ( 0 === strpos( $string, '<h2>' ) ) {
     1953                    $strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
     1954                }
     1955
     1956                if ( 0 === strpos( $string, '<h3>' ) ) {
     1957                    $strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
     1958                }
     1959            }
     1960        }
     1961
     1962        $content = implode( '', $strings );
    18541963        // End of the suggested privacy policy text.
    18551964
     
    18581967         *
    18591968         * @since 4.9.6
     1969         * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
    18601970         *
    1861          * @param $content string The default policy content.
     1971         * @param $content     string The default policy content.
     1972         * @param $strings     array  An array of privacy policy content strings.
     1973         * @param $description bool   Whether policy descriptions should be included.
     1974         * @param $blocks      bool   Whether the content should be formatted for the block editor.
    18621975         */
    1863         return apply_filters( 'wp_get_default_privacy_policy_content', $content );
     1976        return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
    18641977    }
    18651978
     
    18701983     */
    18711984    public static function add_suggested_content() {
    1872         $content = self::get_default_content( true );
     1985        $content = self::get_default_content( true, false );
    18731986        wp_add_privacy_policy_content( __( 'WordPress' ), $content );
    18741987    }
  • trunk/src/wp-admin/includes/upgrade.php

    r44151 r44168  
    193193
    194194            if ( ! $first_post ) {
    195                 /* translators: %s: site link */
    196                 $first_post = __( 'Welcome to %s. This is your first post. Edit or delete it, then start blogging!' );
     195                $first_post = "<!-- wp:paragraph -->\n<p>" .
     196                /* translators: first post content, %s: site link */
     197                __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
     198                "</p>\n<!-- /wp:paragraph -->";
    197199            }
    198200
     
    206208            $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
    207209        } else {
    208             $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
     210            $first_post = "<!-- wp:paragraph -->\n<p>" .
     211            /* translators: first post content, %s: site link */
     212            __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' ) .
     213            "</p>\n<!-- /wp:paragraph -->";
    209214        }
    210215
     
    271276        }
    272277
    273         $first_page = ! empty( $first_page ) ? $first_page : sprintf(
    274             __(
    275                 "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
    276 
    277 <blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)</blockquote>
    278 
    279 ...or something like this:
    280 
    281 <blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
    282 
    283 As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!"
    284             ),
    285             admin_url()
    286         );
     278        if ( empty( $first_page ) ) {
     279            $first_page = "<!-- wp:paragraph -->\n<p>";
     280            /* translators: first page content */
     281            $first_page .= __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:" );
     282            $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     283
     284            $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     285            /* translators: first page content */
     286            $first_page .= __( "Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)" );
     287            $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     288
     289            $first_page .= "<!-- wp:paragraph -->\n<p>";
     290            /* translators: first page content */
     291            $first_page .= __( '...or something like this:' );
     292            $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     293
     294            $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     295            /* translators: first page content */
     296            $first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );
     297            $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     298
     299            $first_page .= "<!-- wp:paragraph -->\n<p>";
     300            $first_page .= sprintf(
     301                /* translators: first page content, %s: site admin URL */
     302                __( 'As a new WordPress user, you should go to <a href="%s">your dashboard</a> to delete this page and create new pages for your content. Have fun!' ),
     303                admin_url()
     304            );
     305            $first_page .= "</p>\n<!-- /wp:paragraph -->";
     306        }
    287307
    288308        $first_post_guid = get_option( 'home' ) . '/?page_id=2';
     
    11891209                }
    11901210
    1191                             $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID ) );
     1211                $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID ) );
    11921212            }
    11931213        }
     
    22352255    }
    22362256
    2237     // 5.0
     2257    // 5.1
    22382258    if ( $wp_current_db_version < 42836 ) {
    22392259        $network_id = get_main_network_id();
Note: See TracChangeset for help on using the changeset viewer.