Make WordPress Core


Ignore:
Timestamp:
04/16/2018 08:52:18 AM (6 years ago)
Author:
azaozz
Message:

Privacy: add a postbox that is shown when editing the privacy policy page, and where plugins and core will output suggested content and additional privacy info. First run.

Props melchoyce, azaozz.
See #43620.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r42875 r42980  
    20152015    include( WP_PLUGIN_DIR . '/' . $plugin );
    20162016}
     2017
     2018/**
     2019 * Helper function for adding plugin specific information to the postbox shown when editing the privacy policy.
     2020 *
     2021 * Intended for use with the `'admin_init'` action.
     2022 *
     2023 * @since 4.9.6
     2024 *
     2025 * @param string $plugin_name The plugin'as name. Will be shown in the privacy policy metabox.
     2026 * @param string $policy_text The content that should appear in the site's privacy policy.
     2027 *                            For more information see the Plugins Handbook https://developer.wordpress.org/plugins/.
     2028 */
     2029function wp_add_privacy_policy_content( $plugin_name, $policy_text ) {
     2030    if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
     2031        require_once( ABSPATH . 'wp-admin/includes/misc.php' );
     2032    }
     2033
     2034    WP_Privacy_Policy_Content::add( $plugin_name, $policy_text );
     2035}
Note: See TracChangeset for help on using the changeset viewer.