diff --git src/wp-admin/includes/admin-filters.php src/wp-admin/includes/admin-filters.php
index 3407e93171..49522be06a 100644
|
|
|
add_action( 'wp_privacy_personal_data_erased', '_wp_privacy_send_erasure_fulfill |
| 142 | 142 | add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 ); |
| 143 | 143 | |
| 144 | 144 | // Show a "postbox" with the text suggestions for a privacy policy. |
| 145 | | add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) ); |
| | 145 | add_action( 'admin_print_scripts', array( 'WP_Privacy_Policy_Content', 'notice' ) ); |
| 146 | 146 | |
| 147 | 147 | // Add the suggested policy text from WordPress. |
| 148 | 148 | add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 ); |
diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
index fac9fd5d26..a43009e022 100644
|
|
|
final class WP_Privacy_Policy_Content { |
| 1621 | 1621 | * @param WP_Post|null $post The currently edited post. Default null. |
| 1622 | 1622 | */ |
| 1623 | 1623 | public static function notice( $post = null ) { |
| 1624 | | $post = get_post( $post ); |
| | 1624 | if ( ! get_current_screen()->is_block_editor() ) { |
| | 1625 | return; |
| | 1626 | } |
| | 1627 | |
| | 1628 | if ( is_null( $post ) ) { |
| | 1629 | global $post; |
| | 1630 | } else { |
| | 1631 | $post = get_post( $post ); |
| | 1632 | } |
| 1625 | 1633 | |
| 1626 | 1634 | if ( ! ( $post instanceof WP_Post ) ) { |
| 1627 | 1635 | return; |
| … |
… |
final class WP_Privacy_Policy_Content { |
| 1637 | 1645 | return; |
| 1638 | 1646 | } |
| 1639 | 1647 | |
| 1640 | | ?> |
| 1641 | | <div class="notice notice-warning inline wp-pp-notice"> |
| 1642 | | <p> |
| 1643 | | <?php |
| 1644 | | /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */ |
| 1645 | | printf( |
| 1646 | | __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ), |
| 1647 | | admin_url( 'tools.php?wp-privacy-policy-guide=1' ), |
| 1648 | | 'target="_blank"', |
| 1649 | | sprintf( |
| 1650 | | '<span class="screen-reader-text"> %s</span>', |
| 1651 | | /* translators: accessibility text */ |
| 1652 | | __( '(opens in a new tab)' ) |
| 1653 | | ) |
| 1654 | | ); |
| 1655 | | ?> |
| 1656 | | </p> |
| 1657 | | </div> |
| 1658 | | <?php |
| | 1648 | $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' ); |
| | 1649 | $action = array( |
| | 1650 | 'url' => admin_url( 'tools.php?wp-privacy-policy-guide=1' ), |
| | 1651 | 'label' => __( 'View Guide' ), |
| | 1652 | ); |
| 1659 | 1653 | |
| | 1654 | wp_enqueue_script( 'wp-notices' ); |
| | 1655 | wp_add_inline_script( |
| | 1656 | 'wp-notices', |
| | 1657 | sprintf( |
| | 1658 | 'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ] } )', |
| | 1659 | $message, |
| | 1660 | wp_json_encode( $action ) |
| | 1661 | ), |
| | 1662 | 'after' |
| | 1663 | ); |
| 1660 | 1664 | } |
| 1661 | 1665 | |
| 1662 | 1666 | /** |