WP_Privacy_Policy_Content::notice( WP_Post $post )

Add a notice with a link to the guide when editing the privacy policy page.


Parameters

$post

(Required) The currently edited post.


Source

File: wp-admin/includes/misc.php

	public static function notice( $post ) {
		if ( ! ( $post instanceof WP_Post ) ) {
			return;
		}

		if ( ! current_user_can( 'manage_privacy_options' ) ) {
			return;
		}

		$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );

		if ( ! $policy_page_id || $policy_page_id != $post->ID ) {
			return;
		}

		?>
		<div class="notice notice-warning inline wp-pp-notice">
			<p>
			<?php
			/* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */
			printf(
				__( '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.' ),
				admin_url( 'tools.php?wp-privacy-policy-guide=1' ),
				'target="_blank"',
				sprintf(
					'<span class="screen-reader-text"> %s</span>',
					/* translators: accessibility text */
					__( '(opens in a new tab)' )
				)
			);
			?>
			</p>
		</div>
		<?php

	}


Changelog

Changelog
Version Description
WP-4.9.6 Introduced.