POST_TYPE, 'post_status' => 'any', 'posts_per_page' => 50, 'paged' => $page, 'fields' => 'ids', 'orderby' => 'ID', 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery -- privacy tools run rarely. 'relation' => 'OR', array( 'key' => 'raplace_email', 'value' => $email, ), array( 'key' => 'raplace_reporter', 'value' => $email, 'compare' => 'LIKE', ), ), ) ); } add_filter( 'wp_privacy_personal_data_exporters', static function ( array $exporters ): array { $exporters['spotsend'] = array( 'exporter_friendly_name' => __( 'Place reports', 'spotsend' ), 'callback' => static function ( string $email, int $page = 1 ): array { $items = array(); $ids = reports_by_email( $email, $page ); foreach ( $ids as $id ) { $report = get_report( $id ); $data = array( array( 'name' => __( 'Place', 'spotsend' ), 'value' => get_the_title( $id ), ), array( 'name' => __( 'Received', 'spotsend' ), 'value' => get_the_date( '', $id ), ), array( 'name' => __( 'Description', 'spotsend' ), 'value' => $report['description'], ), array( 'name' => __( 'Reported by', 'spotsend' ), 'value' => $report['reporter'], ), array( 'name' => __( 'Email', 'spotsend' ), 'value' => $report['email'], ), ); foreach ( $report['photos'] as $i => $photo ) { $data[] = array( /* translators: %d: the photo's number within the report, starting at 1 */ 'name' => sprintf( __( 'Photo %d', 'spotsend' ), $i + 1 ), 'value' => (string) wp_get_attachment_url( $photo ), ); } $items[] = array( 'group_id' => 'raplace-reports', 'group_label' => __( 'Place reports', 'spotsend' ), 'item_id' => 'raplace-report-' . $id, 'data' => $data, ); } return array( 'data' => $items, 'done' => count( $ids ) < 50, ); }, ); return $exporters; } ); add_filter( 'wp_privacy_personal_data_erasers', static function ( array $erasers ): array { $erasers['spotsend'] = array( 'eraser_friendly_name' => __( 'Place reports', 'spotsend' ), 'callback' => static function ( string $email, int $page = 1 ): array { // Erased reports no longer match, so always read the first page. $ids = reports_by_email( $email, 1 ); foreach ( $ids as $id ) { update_post_meta( $id, 'raplace_reporter', wp_privacy_anonymize_data( 'text' ) ); delete_post_meta( $id, 'raplace_email' ); } return array( 'items_removed' => count( $ids ) > 0, 'items_retained' => false, 'messages' => array(), 'done' => count( $ids ) < 50, ); }, ); return $erasers; } ); add_action( 'admin_init', static function () { wp_add_privacy_policy_content( __( 'SpotSend', 'spotsend' ), '
' . esc_html__( 'When you report a place, we store what you write in the form, the photos you add (with the location, camera and time details inside the files removed), and your location if you share it, so we can find and deal with the place. If you give your email address, we send you a confirmation that the report arrived and may reply to you; your name and email are not used for anything else. You can ask us to export or erase them. Erasing removes your name and email from your reports; the photos stay with the report.', 'spotsend' ) . '
' . '' . esc_html__( 'If this site shows a map of resolved reports, a resolved report appears on it with the place as you described it, its categories, the day it was resolved and, if the site chooses, your first photo. Your name, email address and description are never shown.', 'spotsend' ) . '
' . '' . esc_html( sprintf( /* translators: %s: the map tile server's host name, e.g. tile.openstreetmap.org */ __( 'If you open the map on the form, the map images are loaded from %s, which receives your IP address like any website you visit.', 'spotsend' ), (string) wp_parse_url( (string) setting( 'tiles' ), PHP_URL_HOST ) ) ) . '
' ); } );