Make WordPress Core


Ignore:
Timestamp:
05/01/2018 11:41:37 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Privacy: add new wp-admin screens for exporting and removing of personal data.

Props melchoyce, mikejolley, allendav, xkon.
Merges [42967] to the 4.9 branch.
See #43481.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/post.php

    r42589 r43071  
    211211    ) );
    212212
     213    register_post_type( 'user_export_request', array(
     214        'labels'           => array(
     215            'name'          => __( 'Export Personal Data Requests' ),
     216            'singular_name' => __( 'Export Personal Data Request' ),
     217        ),
     218        'public'           => false,
     219        '_builtin'         => true, /* internal use only. don't use this when registering your own post type. */
     220        'hierarchical'     => false,
     221        'rewrite'          => false,
     222        'query_var'        => false,
     223        'can_export'       => false,
     224        'delete_with_user' => false,
     225    ) );
     226
     227    register_post_type( 'user_remove_request', array(
     228        'labels'           => array(
     229            'name'          => __( 'Remove Personal Data Requests' ),
     230            'singular_name' => __( 'Remove Personal Data Request' ),
     231        ),
     232        'public'           => false,
     233        '_builtin'         => true, /* internal use only. don't use this when registering your own post type. */
     234        'hierarchical'     => false,
     235        'rewrite'          => false,
     236        'query_var'        => false,
     237        'can_export'       => false,
     238        'delete_with_user' => false,
     239    ) );
     240
    213241    register_post_status( 'publish', array(
    214242        'label'       => _x( 'Published', 'post status' ),
     
    264292        'internal' => true,
    265293        '_builtin' => true, /* internal use only. */
     294        'exclude_from_search' => false,
     295    ) );
     296
     297    register_post_status( 'request-pending', array(
     298        'label'               => _x( 'Pending', 'request status' ),
     299        'internal'            => true,
     300        '_builtin'            => true, /* internal use only. */
     301        'exclude_from_search' => false,
     302    ) );
     303
     304    register_post_status( 'request-confirmed', array(
     305        'label'               => _x( 'Confirmed', 'request status' ),
     306        'internal'            => true,
     307        '_builtin'            => true, /* internal use only. */
     308        'exclude_from_search' => false,
     309    ) );
     310
     311    register_post_status( 'request-failed', array(
     312        'label'               => _x( 'Failed', 'request status' ),
     313        'internal'            => true,
     314        '_builtin'            => true, /* internal use only. */
     315        'exclude_from_search' => false,
     316    ) );
     317
     318    register_post_status( 'request-completed', array(
     319        'label'               => _x( 'Completed', 'request status' ),
     320        'internal'            => true,
     321        '_builtin'            => true, /* internal use only. */
    266322        'exclude_from_search' => false,
    267323    ) );
     
    728784
    729785    return $status;
     786}
     787
     788/**
     789 * Return statuses for privacy requests.
     790 *
     791 * @since 5.0.0
     792 *
     793 * @return array
     794 */
     795function _wp_privacy_statuses() {
     796    return array(
     797        'request-pending'   => __( 'Pending' ),      // Pending confirmation from user.
     798        'request-confirmed' => __( 'Confirmed' ),    // User has confirmed the action.
     799        'request-failed'    => __( 'Failed' ),       // User failed to confirm the action.
     800        'request-completed' => __( 'Completed' ),    // Admin has handled the request.
     801    );
    730802}
    731803
Note: See TracChangeset for help on using the changeset viewer.