__( 'ReplyPing subscriptions', 'replyping' ), 'callback' => array( $this, 'export' ), ); return $exporters; } /** * Register eraser. * * @param array $erasers Erasers. * @return array */ public function register_eraser( $erasers ) { $erasers['replyping'] = array( 'eraser_friendly_name' => __( 'ReplyPing subscriptions', 'replyping' ), 'callback' => array( $this, 'erase' ), ); return $erasers; } /** * Export subscriptions for an email. * * @param string $email Email. * @param int $page Page. * @return array */ public function export( $email, $page = 1 ) { $items = array(); foreach ( Db::get_by_email( strtolower( sanitize_email( $email ) ) ) as $row ) { $items[] = array( 'group_id' => 'replyping', 'group_label' => __( 'Comment subscriptions', 'replyping' ), 'item_id' => 'replyping-' . (int) $row->id, 'data' => array( array( 'name' => __( 'Post', 'replyping' ), 'value' => get_the_title( (int) $row->post_id ), ), array( 'name' => __( 'Type', 'replyping' ), 'value' => $row->type, ), array( 'name' => __( 'Status', 'replyping' ), 'value' => $row->status, ), array( 'name' => __( 'Consent text', 'replyping' ), 'value' => $row->consent_text, ), array( 'name' => __( 'Subscribed at (UTC)', 'replyping' ), 'value' => $row->created_at, ), array( 'name' => __( 'Confirmed at (UTC)', 'replyping' ), 'value' => (string) $row->confirmed_at, ), ), ); } return array( 'data' => $items, 'done' => true, ); } /** * Erase subscriptions for an email. * * @param string $email Email. * @param int $page Page. * @return array */ public function erase( $email, $page = 1 ) { $removed = Db::delete_by_email( strtolower( sanitize_email( $email ) ) ); return array( 'items_removed' => $removed > 0, 'items_retained' => false, 'messages' => array(), 'done' => true, ); } /** * Suggested privacy policy text. */ public function policy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $text = '

' . esc_html__( 'Comment subscriptions', 'replyping' ) . '

' . '

' . esc_html__( 'Suggested text:', 'replyping' ) . '

' . '

' . esc_html__( 'If you opt in when leaving a comment, we store your email address, the post you subscribed to, the consent wording you agreed to, and the date of subscription so we can email you about new comments. You can unsubscribe at any time using the link in every email. Subscription data is deleted on request through the personal data tools.', 'replyping' ) . '

'; wp_add_privacy_policy_content( 'ReplyPing', wp_kses_post( $text ) ); } }