Make WordPress Core


Ignore:
Timestamp:
05/02/2018 02:58:12 AM (7 years ago)
Author:
SergeyBiryukov
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.
Merges [42980] to the 4.9 branch.
See #43620.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/plugin.php

    r42243 r43101  
    18971897    include( WP_PLUGIN_DIR . '/' . $plugin );
    18981898}
     1899
     1900/**
     1901 * Helper function for adding plugin specific information to the postbox shown when editing the privacy policy.
     1902 *
     1903 * Intended for use with the `'admin_init'` action.
     1904 *
     1905 * @since 4.9.6
     1906 *
     1907 * @param string $plugin_name The plugin'as name. Will be shown in the privacy policy metabox.
     1908 * @param string $policy_text The content that should appear in the site's privacy policy.
     1909 *                            For more information see the Plugins Handbook https://developer.wordpress.org/plugins/.
     1910 */
     1911function wp_add_privacy_policy_content( $plugin_name, $policy_text ) {
     1912    if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
     1913        require_once( ABSPATH . 'wp-admin/includes/misc.php' );
     1914    }
     1915
     1916    WP_Privacy_Policy_Content::add( $plugin_name, $policy_text );
     1917}
Note: See TracChangeset for help on using the changeset viewer.