Changeset 43203
- Timestamp:
- 05/09/2018 08:50:54 PM (7 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/edit.css
r43184 r43203 648 648 649 649 /* Suggested text for privacy policy */ 650 .wp- suggested-policy-content{650 .wp-privacy-policy-guide { 651 651 max-width: 1000px; 652 652 } … … 672 672 } 673 673 674 .wp- suggested-policy-contenth3 {675 font-size: 1 em;674 .wp-privacy-policy-guide h3 { 675 font-size: 1.2em; 676 676 margin: 1em 0 0.5em; 677 677 } … … 686 686 } 687 687 688 .privacy-text-section.text-updated { 689 padding: 1px 15px; 690 border-left: 4px solid #46b450; 691 background-color: #ecf7ed; 692 } 693 688 .privacy-text-box-head, 694 689 .privacy-text-section.text-removed { 695 padding: 1px 14px 1px 12px; 696 border-left: 4px solid #dc3232; 697 background-color: #fbeaea; 698 } 699 700 .privacy-text-meta { 701 font-size: 11px; 690 padding-bottom: 12px; 691 } 692 693 .text-removed .policy-text { 702 694 font-style: italic; 703 color: #6 C7781;695 color: #666; 704 696 font-weight: 600; 705 margin-top: -12px;706 697 } 707 698 … … 712 703 } 713 704 714 .wp- suggested-policy-content.policy-text h2 {705 .wp-privacy-policy-guide .policy-text h2 { 715 706 margin: 1.2em 0 1em; 716 707 padding: 0; … … 1675 1666 float: none; 1676 1667 width: auto; 1668 height: 100%; 1677 1669 } 1678 1670 -
trunk/src/wp-admin/includes/misc.php
r43184 r43203 1558 1558 printf( 1559 1559 __( 'Need help putting together your new Privacy Policy page? %s for recommendations on what content to include, along with policies suggested by your plugins and theme.' ), 1560 '<a href="' . admin_url( ' privacy.php?wp-suggested-policy-content=1' ) . '" target="_blank">' . __( 'Check out our guide' ) . '</a>' );1560 '<a href="' . admin_url( 'tools.php?wp-privacy-policy-guide=1' ) . '" target="_blank">' . __( 'Check out our guide' ) . '</a>' ); 1561 1561 ?> 1562 1562 </p> … … 1582 1582 1583 1583 foreach ( $content_array as $section ) { 1584 $class = $meta = '';1584 $class = $meta = $removed = ''; 1585 1585 1586 1586 if ( ! empty( $section['removed'] ) ) { … … 1588 1588 $date = date_i18n( $date_format, $section['removed'] ); 1589 1589 $meta = sprintf( __( 'Removed %s.' ), $date ); 1590 1591 $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' ); 1592 $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>'; 1590 1593 } elseif ( ! empty( $section['updated'] ) ) { 1591 1594 $class = ' text-updated'; … … 1603 1606 1604 1607 $content .= '<div class="privacy-text-section' . $class . '">'; 1608 $content .= '<a id="' . $toc_id . '"> </a>'; 1605 1609 $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>'; 1606 $content .= '<a id="' . $toc_id . '"></a>';1610 $content .= $removed; 1607 1611 1608 1612 $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>'; … … 1655 1659 * @since 4.9.6 1656 1660 * 1661 * @param bool $descr Whether to include the descriptions undet the section headings. Default false. 1657 1662 * @return string The default policy content. 1658 1663 */ 1659 public static function get_default_content( ) {1660 $suggested_text = '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>';1664 public static function get_default_content( $descr = false ) { 1665 $suggested_text = $descr ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : ''; 1661 1666 1662 1667 // Start of the suggested privacy policy text. 1663 1668 $content = 1664 1669 '<div class="wp-suggested-text">' . 1665 '<h2>' . __( 'Who we are' ) . '</h2>' . 1670 '<h2>' . __( 'Who we are' ) . '</h2>'; 1671 $descr && $content .= 1666 1672 '<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>' . 1667 '<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>' .1668 1673 '<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>'; 1674 $content .= 1669 1675 /* translators: %s Site URL */ 1670 1676 '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>' . 1671 1677 1672 '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>' . 1678 '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>'; 1679 $descr && $content .= 1673 1680 '<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>' . 1674 1681 '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>' . 1675 1682 '<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>' . 1676 1683 '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user’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>' . 1677 '<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>' . 1678 1679 '<h3>' . __( 'Comments' ) . '</h3>' . 1680 '<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>' . 1684 '<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>'; 1685 1686 $content .= 1687 '<h3>' . __( 'Comments' ) . '</h3>'; 1688 $descr && $content .= 1689 '<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>'; 1690 $content .= 1681 1691 '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection.' ) . '</p>' . 1682 1692 '<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>' . 1683 1693 1684 '<h3>' . __( 'Media' ) . '</h3>' . 1685 '<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>' . 1694 '<h3>' . __( 'Media' ) . '</h3>'; 1695 $descr && $content .= 1696 '<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>'; 1697 $content .= 1686 1698 '<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>' . 1687 1699 1688 '<h3>' . __( 'Contact forms' ) . '</h3>' . 1689 '<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>' . 1690 1691 '<h3>' . __( 'Cookies' ) . '</h3>' . 1692 '<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>' . 1700 '<h3>' . __( 'Contact forms' ) . '</h3>'; 1701 $descr && $content .= 1702 '<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>'; 1703 1704 $content .= 1705 '<h3>' . __( 'Cookies' ) . '</h3>'; 1706 $descr && $content .= 1707 '<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>'; 1708 $content .= 1693 1709 '<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>' . 1694 1710 '<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>' . … … 1700 1716 '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracing your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>' . 1701 1717 1702 '<h3>' . __( 'Analytics' ) . '</h3>' . 1718 '<h3>' . __( 'Analytics' ) . '</h3>'; 1719 $descr && $content .= 1703 1720 '<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’s privacy policy, if any.' ) . '</p>' . 1704 '<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>' . 1705 1706 '<h2>' . __( 'Who we share your data with' ) . '</h2>' . 1721 '<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>'; 1722 1723 $content .= 1724 '<h2>' . __( 'Who we share your data with' ) . '</h2>'; 1725 $descr && $content .= 1707 1726 '<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>' . 1708 '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>' . 1709 1710 '<h2>' . __( 'How long we retain your data' ) . '</h2>' . 1711 '<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>' . 1727 '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>'; 1728 1729 $content .= 1730 '<h2>' . __( 'How long we retain your data' ) . '</h2>'; 1731 $descr && $content .= 1732 '<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>'; 1733 $content .= 1712 1734 '<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>' . 1713 1735 '<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>' . 1714 1736 1715 '<h2>' . __( 'What rights you have over your data' ) . '</h2>' . 1716 '<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>' . 1737 '<h2>' . __( 'What rights you have over your data' ) . '</h2>'; 1738 $descr && $content .= 1739 '<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>'; 1740 $content .= 1717 1741 '<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>' . 1718 1742 1719 '<h2>' . __( 'Where we send your data' ) . '</h2>' . 1743 '<h2>' . __( 'Where we send your data' ) . '</h2>'; 1744 $descr && $content .= 1720 1745 '<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>' . 1721 '<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>' . 1722 '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>' . 1723 1724 '<h2>' . __( 'Your contact information' ) . '</h2>' . 1725 '<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>' . 1726 1727 '<h2>' . __( 'Additional information' ) . '</h2>' . 1728 '<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>' . 1729 1730 '<h3>' . __( 'How we protect your data' ) . '</h3>' . 1731 '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users’ 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>' . 1732 1733 '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>' . 1734 '<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>' . 1735 1736 '<h3>' . __( 'What third parties we receive data from' ) . '</h3>' . 1737 '<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>' . 1738 1739 '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>' . 1740 '<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>' . 1741 1742 '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>' . 1743 '<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>' . 1746 '<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>'; 1747 $content .= 1748 '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>'; 1749 1750 '<h2>' . __( 'Your contact information' ) . '</h2>'; 1751 $descr && $content .= 1752 '<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>'; 1753 1754 $content .= 1755 '<h2>' . __( 'Additional information' ) . '</h2>'; 1756 $descr && $content .= 1757 '<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>'; 1758 1759 $content .= 1760 '<h3>' . __( 'How we protect your data' ) . '</h3>'; 1761 $descr && $content .= 1762 '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users’ 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>'; 1763 1764 $content .= 1765 '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>'; 1766 $descr && $content .= 1767 '<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>'; 1768 1769 $content .= 1770 '<h3>' . __( 'What third parties we receive data from' ) . '</h3>'; 1771 $descr && $content .= 1772 '<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>'; 1773 1774 $content .= 1775 '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>'; 1776 $descr && $content .= 1777 '<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>'; 1778 1779 $content .= 1780 '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>'; 1781 $descr && $content .= 1782 '<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>'; 1783 $content .= 1744 1784 '</div>'; 1745 1785 // End of the suggested privacy policy text. 1746 1786 1747 1787 /** … … 1761 1801 */ 1762 1802 public static function add_suggested_content() { 1763 $content = self::get_default_content( );1803 $content = self::get_default_content( true ); 1764 1804 wp_add_privacy_policy_content( __( 'WordPress' ), $content ); 1765 1805 } -
trunk/src/wp-admin/privacy.php
r43201 r43203 14 14 } 15 15 16 if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {17 require_once( ABSPATH . 'wp-admin/includes/misc.php' );18 }19 20 // "Borrow" xfn.js for now so we don't have to create new files.21 wp_enqueue_script( 'xfn' );22 23 16 $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; 24 17 … … 41 34 ); 42 35 } elseif ( 'create-privacy-page' === $action ) { 36 37 if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { 38 require_once( ABSPATH . 'wp-admin/includes/misc.php' ); 39 } 43 40 44 41 $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content(); … … 106 103 ?> 107 104 <div class="wrap"> 108 <?php109 110 if ( isset( $_GET['wp-suggested-policy-content'] ) ) {111 112 ?>113 <h1><?php _e( 'Privacy Policy Guide' ); ?></h1>114 <div class="wp-suggested-policy-content">115 <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>116 </div>117 <?php118 119 } else {120 121 ?>122 105 <h1><?php _e( 'Privacy Settings' ); ?></h1> 123 106 <h2><?php _e( 'Privacy Policy page' ); ?></h2> … … 135 118 </p> 136 119 <?php 120 137 121 if ( $privacy_policy_page_exists ) { 138 122 $edit_href = add_query_arg( … … 145 129 146 130 $view_href = get_permalink( $privacy_policy_page_id ); 131 147 132 ?> 148 133 <p class="tools-privacy-edit"><strong> 149 134 <?php 150 printf( 151 /* translators: 1: URL to edit page, 2: URL to view page */ 152 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), 153 $edit_href, 154 $view_href 155 ); 135 136 /* translators: 1: URL to edit page, 2: URL to view page */ 137 printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), $edit_href, $view_href ); 138 156 139 ?> 157 140 </strong></p> 141 <p> 142 <?php 143 144 printf( 145 __( 'Need help putting together your new Privacy Policy page? %s for recommendations on what content to include, along with policies suggested by your plugins and theme.' ), 146 '<a href="' . admin_url( 'tools.php?wp-privacy-policy-guide' ) . '">' . __( 'Check out our guide' ) . '</a>' 147 ); 148 149 ?> 150 </p> 158 151 <?php 159 152 } … … 210 203 </div> 211 204 <?php 212 } // End if/else isset( $_GET['wp-suggested-policy-content'] ).213 205 214 206 include( ABSPATH . 'wp-admin/admin-footer.php' ); -
trunk/src/wp-admin/tools.php
r41584 r43203 10 10 require_once( dirname( __FILE__ ) . '/admin.php' ); 11 11 12 $ title = __('Tools');12 $is_privacy_guide = ( isset( $_GET['wp-privacy-policy-guide'] ) && current_user_can( 'manage_privacy_options' ) ); 13 13 14 get_current_screen()->add_help_tab( array( 15 'id' => 'converter', 16 'title' => __('Categories and Tags Converter'), 17 'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' . 18 '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>', 19 ) ); 14 if ( $is_privacy_guide ) { 15 $title = __( 'Privacy Policy Guide' ); 20 16 21 get_current_screen()->set_help_sidebar( 22 '<p><strong>' . __('For more information:') . '</strong></p>' . 23 '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' . 24 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' 25 ); 17 // "Borrow" xfn.js for now so we don't have to create new files. 18 wp_enqueue_script( 'xfn' ); 19 20 } else { 21 22 $title = __('Tools'); 23 24 get_current_screen()->add_help_tab( array( 25 'id' => 'converter', 26 'title' => __('Categories and Tags Converter'), 27 'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' . 28 '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>', 29 ) ); 30 31 get_current_screen()->set_help_sidebar( 32 '<p><strong>' . __('For more information:') . '</strong></p>' . 33 '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' . 34 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' 35 ); 36 } 26 37 27 38 require_once( ABSPATH . 'wp-admin/admin-header.php' ); … … 31 42 <h1><?php echo esc_html( $title ); ?></h1> 32 43 <?php 33 if ( current_user_can( 'import' ) ) :34 $cats = get_taxonomy('category');35 $tags = get_taxonomy('post_tag');36 if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>37 <div class="card">38 <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2>39 <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>40 </div>41 <?php42 endif;43 endif;44 44 45 /** 46 * Fires at the end of the Tools Administration screen. 47 * 48 * @since 2.8.0 49 */ 50 do_action( 'tool_box' ); 45 if ( $is_privacy_guide ) { 46 ?> 47 <div class="wp-privacy-policy-guide"> 48 <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?> 49 </div> 50 <?php 51 52 } else { 53 54 if ( current_user_can( 'import' ) ) : 55 $cats = get_taxonomy('category'); 56 $tags = get_taxonomy('post_tag'); 57 if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?> 58 <div class="card"> 59 <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2> 60 <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p> 61 </div> 62 <?php 63 endif; 64 endif; 65 66 /** 67 * Fires at the end of the Tools Administration screen. 68 * 69 * @since 2.8.0 70 */ 71 do_action( 'tool_box' ); 72 } 51 73 ?> 52 74 </div>
Note: See TracChangeset
for help on using the changeset viewer.