A WordPress-centric search engine for devs and theme authors



wp_add_privacy_policy_content ›

Since4.9.6
Deprecatedn/a
wp_add_privacy_policy_content ( $plugin_name, $policy_text )
Parameters: (2)
  • (string) $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.
    Required: Yes
  • (string) $policy_text The suggested content for inclusion in the policy. For more information see the Plugins Handbook https://developer.wordpress.org/plugins/.
    Required: Yes
Defined at:
Codex:

Helper function for adding content to the postbox shown when editing the privacy policy.

Plugins and themes should suggest text for inclusion in the site's privacy policy. The suggested text should contain information about any functionality that affects user privacy, and will be shown in the Suggested Privacy Policy Content postbox.

A plugin or theme can use this function multiple times as long as it will help to better present the suggested policy content. For example modular plugins such as WooCommerse or Jetpack can add or remove suggested content depending on the modules/extensions that are enabled.

Intended for use with the 'admin_init' action.



Source

function wp_add_privacy_policy_content( $plugin_name, $policy_text ) {
	if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
		require_once( ABSPATH . 'wp-admin/includes/misc.php' );
	}

	WP_Privacy_Policy_Content::add( $plugin_name, $policy_text );
}