WordPress.org

Make WordPress Core

Ticket #45057: 45057.3.diff

File 45057.3.diff, 1.4 KB (added by desrosj, 3 years ago)

Leave the inline class on the notice.

  • src/wp-admin/includes/admin-filters.php

     
    144144add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 100 );
    145145
    146146// Show a "postbox" with the text suggestions for a privacy policy.
    147 add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'notice' ) );
     147add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );
    148148
    149149// Add the suggested policy text from WordPress.
    150150add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );
  • src/wp-admin/includes/misc.php

     
    15401540         * Add a notice with a link to the guide when editing the privacy policy page.
    15411541         *
    15421542         * @since 4.9.6
     1543         * @since 5.0.0 The $post parameter is now optional.
    15431544         *
    1544          * @param WP_Post $post The currently edited post.
     1545         * @param WP_Post|null $post The currently edited post. Default is null.
    15451546         */
    1546         public static function notice( $post ) {
     1547        public static function notice( $post = null ) {
     1548                $post = get_post( $post );
     1549
    15471550                if ( ! ( $post instanceof WP_Post ) ) {
    15481551                        return;
    15491552                }