Make WordPress Core

Ticket #45057: 45057.2.diff

File 45057.2.diff, 1.7 KB (added by desrosj, 6 years ago)
  • 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                }
     
    15591562                }
    15601563
    15611564                ?>
    1562                 <div class="notice notice-warning inline wp-pp-notice">
     1565                <div class="notice notice-warning wp-pp-notice">
    15631566                        <p>
    15641567                        <?php
    15651568                        /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */