diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index d0dc33b913..44045a47f3 100644
|
a
|
b
|
final class WP_Privacy_Policy_Content { |
| 1619 | 1619 | * @param WP_Post|null $post The currently edited post. Default null. |
| 1620 | 1620 | */ |
| 1621 | 1621 | public static function notice( $post = null ) { |
| 1622 | | $post = get_post( $post ); |
| | 1622 | if ( is_null( $post ) ) { |
| | 1623 | global $post; |
| | 1624 | } else { |
| | 1625 | $post = get_post( $post ); |
| | 1626 | } |
| 1623 | 1627 | |
| 1624 | 1628 | if ( ! ( $post instanceof WP_Post ) ) { |
| 1625 | 1629 | return; |
| … |
… |
final class WP_Privacy_Policy_Content { |
| 1631 | 1635 | |
| 1632 | 1636 | $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); |
| 1633 | 1637 | |
| 1634 | | if ( ! $policy_page_id || $policy_page_id != $post->ID ) { |
| | 1638 | if ( ! $policy_page_id || $policy_page_id !== $post->ID ) { |
| 1635 | 1639 | return; |
| 1636 | 1640 | } |
| 1637 | 1641 | |
| 1638 | | ?> |
| 1639 | | <div class="notice notice-warning inline wp-pp-notice"> |
| 1640 | | <p> |
| 1641 | | <?php |
| 1642 | | /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */ |
| 1643 | | printf( |
| 1644 | | __( '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.' ), |
| 1645 | | esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) ), |
| 1646 | | 'target="_blank"', |
| | 1642 | $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.' ); |
| | 1643 | $url = esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) ); |
| | 1644 | $label = __( 'View Privacy Policy Guide.' ); |
| | 1645 | |
| | 1646 | if ( get_current_screen()->is_block_editor() ) { |
| | 1647 | wp_enqueue_script( 'wp-notices' ); |
| | 1648 | $action = array( |
| | 1649 | 'url' => $url, |
| | 1650 | 'label' => $label, |
| | 1651 | ); |
| | 1652 | wp_add_inline_script( |
| | 1653 | 'wp-notices', |
| 1647 | 1654 | sprintf( |
| 1648 | | '<span class="screen-reader-text"> %s</span>', |
| 1649 | | /* translators: accessibility text */ |
| 1650 | | __( '(opens in a new tab)' ) |
| 1651 | | ) |
| | 1655 | 'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )', |
| | 1656 | $message, |
| | 1657 | wp_json_encode( $action ) |
| | 1658 | ), |
| | 1659 | 'after' |
| 1652 | 1660 | ); |
| | 1661 | } else { |
| 1653 | 1662 | ?> |
| 1654 | | </p> |
| 1655 | | </div> |
| 1656 | | <?php |
| 1657 | | |
| | 1663 | <div class="notice notice-warning inline wp-pp-notice"> |
| | 1664 | <p> |
| | 1665 | <?php |
| | 1666 | echo $message; |
| | 1667 | printf( |
| | 1668 | /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: link text 4: accessibility text */ |
| | 1669 | __( ' <a href="%1$s" %2$s>%3$s%4$s</a>' ), |
| | 1670 | $url, |
| | 1671 | 'target="_blank"', |
| | 1672 | $label, |
| | 1673 | sprintf( |
| | 1674 | '<span class="screen-reader-text"> %s</span>', |
| | 1675 | /* translators: accessibility text */ |
| | 1676 | __( '(opens in a new tab)' ) |
| | 1677 | ) |
| | 1678 | ); |
| | 1679 | ?> |
| | 1680 | </p> |
| | 1681 | </div> |
| | 1682 | <?php |
| | 1683 | } |
| 1658 | 1684 | } |
| 1659 | 1685 | |
| 1660 | 1686 | /** |