diff --git a/projects/packages/forms/changelog/update-forms-notes-hold-status b/projects/packages/forms/changelog/update-forms-notes-hold-status new file mode 100644 index 000000000000..229566e4a2cf --- /dev/null +++ b/projects/packages/forms/changelog/update-forms-notes-hold-status @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Notes: Keep notes on responses visible only to people who can manage responses. diff --git a/projects/packages/forms/src/contact-form/class-contact-form-endpoint.php b/projects/packages/forms/src/contact-form/class-contact-form-endpoint.php index d632b6a24c74..0624a73e9826 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-endpoint.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-endpoint.php @@ -1698,6 +1698,20 @@ public function get_item_permissions_check( $request ) { //phpcs:ignore Variable return true; } + /** + * Check whether the current user can read a feedback post. + * + * Core's comments controller also calls this to decide who may read a response's notes. + * + * @since $$next-version$$ + * + * @param \WP_Post $post Post object. + * @return bool + */ + public function check_read_permission( $post ) { //phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + return true === $this->get_items_permissions_check( new WP_REST_Request() ); + } + /** * Get static metadata for an integration (without status checks). * diff --git a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php index 9fcc49328851..35d39ccd493d 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php @@ -246,6 +246,14 @@ protected function __construct() { // Restrict feedback comments to logged-in users only add_filter( 'comments_open', array( $this, 'restrict_feedback_comments_to_logged_in' ), 10, 2 ); + // Notes come in through REST and through wp_new_comment() (e.g. the WordPress.com v1.1 replies endpoint). + // Priority 20 so these run after Akismet's verdict at 1 and 10. + add_filter( 'pre_comment_approved', array( $this, 'hold_feedback_notes' ), 20, 2 ); + add_filter( 'preprocess_comment', array( $this, 'prepare_feedback_note' ), 20 ); + add_filter( 'rest_pre_insert_comment', array( $this, 'prepare_feedback_note' ), 20 ); + add_action( 'transition_comment_status', array( $this, 'keep_feedback_notes_out_of_spam' ), 20, 3 ); + add_action( 'pre_get_comments', array( $this, 'exclude_feedback_notes_from_comment_queries' ) ); + add_filter( 'notify_moderator', array( $this, 'skip_moderation_email_for_feedback_notes' ), 10, 2 ); // custom post type we'll use to keep copies of the feedback items register_post_type( @@ -282,6 +290,8 @@ protected function __construct() { 'edit_post' => 'edit_page', 'delete_post' => 'delete_page', 'read_post' => 'read_page', + // Only people who manage responses may read them, or the notes on them. + 'read' => 'edit_pages', ), 'map_meta_cap' => true, ) @@ -2747,6 +2757,11 @@ public function register_personal_data_exporter( $exporters ) { 'callback' => array( $this, 'personal_data_exporter' ), ); + $exporters['jetpack-feedback-notes'] = array( + 'exporter_friendly_name' => __( 'Form response notes', 'jetpack-forms' ), + 'callback' => array( $this, 'personal_data_notes_exporter' ), + ); + return $exporters; } @@ -2765,9 +2780,61 @@ public function register_personal_data_eraser( $erasers ) { 'callback' => array( $this, 'personal_data_eraser' ), ); + $erasers['jetpack-feedback-notes'] = array( + 'eraser_friendly_name' => __( 'Form response notes', 'jetpack-forms' ), + 'callback' => array( $this, 'personal_data_notes_eraser' ), + ); + return $erasers; } + /** + * Exports notes left on responses, which core's comment exporter skips because of their comment type. + * + * @since $$next-version$$ + * + * @param string $email Email address. + * @param int $page Page to export. + * @return array Associative array with keys expected by core. + */ + public function personal_data_notes_exporter( $email, $page = 1 ) { + return self::run_for_feedback_notes_only( 'wp_comments_personal_data_exporter', $email, $page ); + } + + /** + * Anonymizes notes left on responses, which core's comment eraser skips because of their comment type. + * + * @since $$next-version$$ + * + * @param string $email Email address. + * @param int $page Page to erase. + * @return array Associative array with keys expected by core. + */ + public function personal_data_notes_eraser( $email, $page = 1 ) { + return self::run_for_feedback_notes_only( 'wp_comments_personal_data_eraser', $email, $page ); + } + + /** + * Run a core comment privacy callback with its comment queries limited to response notes. + * + * @param callable $callback Core exporter or eraser. + * @param string $email Email address. + * @param int $page Page number. + * @return array + */ + private static function run_for_feedback_notes_only( $callback, $email, $page ) { + $only_notes = static function ( $query ) { + $query->query_vars['type'] = Feedback::NOTE_COMMENT_TYPE; + }; + + add_action( 'pre_get_comments', $only_notes, 5 ); + try { + return $callback( $email, $page ); + } finally { + remove_action( 'pre_get_comments', $only_notes, 5 ); + } + } + /** * Exports personal data. * @@ -3952,6 +4019,109 @@ public function restrict_feedback_comments_to_logged_in( $open, $post_id ) { return current_user_can( 'edit_pages' ); } + /** + * Whether a post ID belongs to a feedback post. + * + * @param mixed $post_id Post ID. + * @return bool + */ + private static function is_feedback_post( $post_id ) { + return ! empty( $post_id ) && Feedback::POST_TYPE === get_post_type( (int) $post_id ); + } + + /** + * Store notes on feedback posts held; reads are gated by the endpoint, not by this status. + * + * Only people who can manage responses can leave notes, so spam and trash verdicts don't apply. + * + * @since $$next-version$$ + * + * @param int|string|\WP_Error $approved The approval status. + * @param array $commentdata Comment data. + * @return int|string|\WP_Error + */ + public function hold_feedback_notes( $approved, $commentdata ) { + if ( is_wp_error( $approved ) || ! self::is_feedback_post( $commentdata['comment_post_ID'] ?? 0 ) ) { + return $approved; + } + + return 0; + } + + /** + * Give comments on feedback posts the note comment type, and keep them held. + * + * Core's REST API only accepts core types on create, and Akismet sets its REST verdict after the approval check. + * + * @since $$next-version$$ + * + * @param array|\WP_Error $commentdata Comment data. + * @return array|\WP_Error + */ + public function prepare_feedback_note( $commentdata ) { + if ( ! is_array( $commentdata ) || ! self::is_feedback_post( $commentdata['comment_post_ID'] ?? 0 ) ) { + return $commentdata; + } + + $commentdata['comment_type'] = Feedback::NOTE_COMMENT_TYPE; + if ( isset( $commentdata['comment_approved'] ) ) { + $commentdata['comment_approved'] = 0; + } + + return $commentdata; + } + + /** + * Put a note back on hold when it's marked as spam, such as by Akismet's bulk recheck of held comments. + * + * Notes don't appear in wp-admin's Spam view, so Akismet would otherwise delete them unseen. + * + * @since $$next-version$$ + * + * @param string $new_status New comment status. + * @param string $old_status Previous comment status. + * @param \WP_Comment $comment Comment object. + */ + public function keep_feedback_notes_out_of_spam( $new_status, $old_status, $comment ) { //phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + if ( 'spam' === $new_status && Feedback::NOTE_COMMENT_TYPE === $comment->comment_type ) { + wp_set_comment_status( $comment->comment_ID, 'hold' ); + } + } + + /** + * Leave notes out of comment queries that don't ask for them, as core does for its `note` type. + * + * This keeps them out of the Comments screen, its counts, and the Activity dashboard widget. + * + * @since $$next-version$$ + * + * @param \WP_Comment_Query $query Comment query. + */ + public function exclude_feedback_notes_from_comment_queries( $query ) { + $requested = array_merge( (array) $query->query_vars['type'], (array) $query->query_vars['type__in'] ); + + if ( in_array( 'all', $requested, true ) || in_array( Feedback::NOTE_COMMENT_TYPE, $requested, true ) ) { + return; + } + + $query->query_vars['type__not_in'] = array_merge( (array) $query->query_vars['type__not_in'], array( Feedback::NOTE_COMMENT_TYPE ) ); + } + + /** + * Don't email moderators about notes, which are held by design rather than awaiting review. + * + * @since $$next-version$$ + * + * @param bool $maybe_notify Whether to notify the moderators. + * @param int $comment_id Comment ID. + * @return bool + */ + public function skip_moderation_email_for_feedback_notes( $maybe_notify, $comment_id ) { + $comment = get_comment( $comment_id ); + + return $comment && Feedback::NOTE_COMMENT_TYPE === $comment->comment_type ? false : $maybe_notify; + } + /** * Kludge method: reverses the output of a standard print_r( $array ). * Sort of what unserialize does to a serialized object. diff --git a/projects/packages/forms/src/contact-form/class-feedback.php b/projects/packages/forms/src/contact-form/class-feedback.php index 36a3b2577eba..f80adf524d4d 100644 --- a/projects/packages/forms/src/contact-form/class-feedback.php +++ b/projects/packages/forms/src/contact-form/class-feedback.php @@ -40,6 +40,15 @@ class Feedback { */ public const STATUS_READ = 'closed'; + /** + * Comment type for notes left on a response. + * + * @since $$next-version$$ + * + * @var string + */ + public const NOTE_COMMENT_TYPE = 'jetpack_form_note'; + /** * Meta key used to store the source post ID on feedback posts. * diff --git a/projects/packages/forms/src/dashboard/components/feedback-comments/index.tsx b/projects/packages/forms/src/dashboard/components/feedback-comments/index.tsx index 48d171a4ec8e..c5a933960b0c 100644 --- a/projects/packages/forms/src/dashboard/components/feedback-comments/index.tsx +++ b/projects/packages/forms/src/dashboard/components/feedback-comments/index.tsx @@ -10,6 +10,7 @@ import { store as noticesStore } from '@wordpress/notices'; /** * Internal dependencies */ +import { NOTE_COMMENT_TYPE } from '../../constants'; import CommentItem from './comment-item'; import type { FeedbackComment } from '../../../types'; import type { JSX } from 'react'; @@ -51,19 +52,21 @@ const FeedbackComments = ( { postId }: FeedbackCommentsProps ): JSX.Element => { isLoadingComments, } = useSelect( select => { - const commentsData = select( coreStore ).getEntityRecords( 'root', 'comment', { + // Notes have their own type, which core only returns when asked. `all` also keeps a note a moderator approved. + // One shared query so the total comes from the same request as the records. + const query = { per_page: perPage, page, + post: postId, + status: 'all', + type: NOTE_COMMENT_TYPE, orderby: 'date', order: 'asc', - post: postId, - } ) as FeedbackComment[] | null | undefined; + }; + const commentsData = select( coreStore ).getEntityRecords( 'root', 'comment', query ) as + FeedbackComment[] | null | undefined; - const total = select( coreStore ).getEntityRecordsTotalItems( 'root', 'comment', { - per_page: perPage, - page, - post: postId, - } ); + const total = select( coreStore ).getEntityRecordsTotalItems( 'root', 'comment', query ); return { comments: commentsData, @@ -200,7 +203,14 @@ const FeedbackComments = ( { postId }: FeedbackCommentsProps ): JSX.Element => { return next; } ); try { - await deleteEntityRecord( 'root', 'comment', commentId, {}, { throwOnError: true } ); + // Notes have no Trash view to restore them from, so delete them outright. + await deleteEntityRecord( + 'root', + 'comment', + commentId, + { force: true }, + { throwOnError: true } + ); createSuccessNotice( __( 'Note deleted.', 'jetpack-forms' ) ); // Remove deleted comment from local lists so UI updates immediately. setLoadedComments( prev => prev.filter( c => c.id !== commentId ) ); diff --git a/projects/packages/forms/src/dashboard/constants.ts b/projects/packages/forms/src/dashboard/constants.ts index fdbb0bc0c84f..29a42b6561bd 100644 --- a/projects/packages/forms/src/dashboard/constants.ts +++ b/projects/packages/forms/src/dashboard/constants.ts @@ -7,6 +7,11 @@ import { __ } from '@wordpress/i18n'; */ import type { QueryParams } from './inbox/stage/types.tsx'; +/** + * Comment type of response notes; matches `Feedback::NOTE_COMMENT_TYPE` in PHP. + */ +export const NOTE_COMMENT_TYPE = 'jetpack_form_note'; + /** * All form status filter values, including the virtual "all" filter. */ diff --git a/projects/packages/forms/tests/php/contact-form/Contact_Form_Endpoint_Test.php b/projects/packages/forms/tests/php/contact-form/Contact_Form_Endpoint_Test.php index ec9e40eeed3d..970151eea165 100644 --- a/projects/packages/forms/tests/php/contact-form/Contact_Form_Endpoint_Test.php +++ b/projects/packages/forms/tests/php/contact-form/Contact_Form_Endpoint_Test.php @@ -4,6 +4,7 @@ require_once __DIR__ . '/class-utility.php'; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\PreserveGlobalState; use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; @@ -1922,4 +1923,63 @@ public function test_get_crm_integration_follows_a_symlinked_renamed_plugin_fold $this->assertSame( 'HereTogetherCRM/HereTogetherCRM', $data['pluginFile'] ); $this->assertTrue( $data['isActive'] ); } + + /** + * Only users who can manage responses may read a response's notes. + * + * @dataProvider provide_note_readers + * + * @param string|null $role Role of the requesting user, or null when logged out. + * @param bool $panel_query Whether to send the dashboard's `status` and `type` params, which core reserves for `edit_posts`. + * @param int $expected_status Expected HTTP status. + */ + #[DataProvider( 'provide_note_readers' )] + public function test_feedback_notes_are_readable_only_by_response_managers( $role, $panel_query, $expected_status ) { + $feedback_id = wp_insert_post( + array( + 'post_type' => 'feedback', + 'post_status' => 'publish', + ) + ); + + $user_id = 0; + if ( null !== $role ) { + $user_id = wp_insert_user( + array( + 'user_login' => 'note_reader_' . $role, + 'user_pass' => 'password', + 'role' => $role, + ) + ); + } + wp_set_current_user( $user_id ); + + $request = new WP_REST_Request( 'GET', '/wp/v2/comments' ); + $params = array( 'post' => $feedback_id ); + if ( $panel_query ) { + $params += array( + 'status' => 'all', + 'type' => Feedback::NOTE_COMMENT_TYPE, + ); + } + $request->set_query_params( $params ); + $response = $this->server->dispatch( $request ); + + $this->assertSame( $expected_status, $response->get_status() ); + } + + /** + * Roles and the status each gets when listing a response's notes. + * + * @return array + */ + public static function provide_note_readers() { + return array( + 'logged out' => array( null, false, 401 ), + 'subscriber' => array( 'subscriber', false, 403 ), + 'author' => array( 'author', true, 403 ), + 'editor' => array( 'editor', true, 200 ), + 'administrator' => array( 'administrator', true, 200 ), + ); + } } diff --git a/projects/packages/forms/tests/php/contact-form/Contact_Form_Plugin_Test.php b/projects/packages/forms/tests/php/contact-form/Contact_Form_Plugin_Test.php index 4aa8f0ea0b12..a64ad75bcbc7 100644 --- a/projects/packages/forms/tests/php/contact-form/Contact_Form_Plugin_Test.php +++ b/projects/packages/forms/tests/php/contact-form/Contact_Form_Plugin_Test.php @@ -1893,6 +1893,291 @@ public function test_comment_filter_only_affects_feedback_posts() { $this->assertTrue( $comments_open, 'Comment filter should not affect non-feedback posts' ); } + /** + * Notes on responses are always stored held, whatever core or Akismet decided. + * + * @dataProvider provide_note_approvals + * + * @param string $post_type Post type the comment is left on. + * @param int|string $approved Approval status core computed. + * @param int|string $expected Approval status that should be stored. + */ + #[DataProvider( 'provide_note_approvals' )] + public function test_feedback_notes_are_held( $post_type, $approved, $expected ) { + Contact_Form_Plugin::init(); + $post_id = wp_insert_post( + array( + 'post_type' => $post_type, + 'post_status' => 'publish', + ) + ); + + $result = apply_filters( 'pre_comment_approved', $approved, array( 'comment_post_ID' => $post_id ) ); + + $this->assertSame( $expected, $result ); + } + + /** + * Post type, computed approval and the approval that should be stored. + * + * @return array + */ + public static function provide_note_approvals() { + return array( + 'approved note is held' => array( 'feedback', 1, 0 ), + 'Akismet spam verdict is held' => array( 'feedback', 'spam', 0 ), + 'regular post comment untouched' => array( 'post', 1, 1 ), + 'regular post spam untouched' => array( 'post', 'spam', 'spam' ), + ); + } + + /** + * Comments on responses get the note type, and stay held after Akismet's REST verdict. + * + * @dataProvider provide_note_type_cases + * + * @param string $hook Filter the comment data passes through. + * @param string $post_type Post type the comment is left on. + * @param string $expected_type Comment type that should be stored. + * @param int|string $expected_approved Approval status that should be stored. + */ + #[DataProvider( 'provide_note_type_cases' )] + public function test_feedback_notes_get_note_type( $hook, $post_type, $expected_type, $expected_approved ) { + Contact_Form_Plugin::init(); + $post_id = wp_insert_post( + array( + 'post_type' => $post_type, + 'post_status' => 'publish', + ) + ); + + $data = apply_filters( + $hook, + array( + 'comment_post_ID' => $post_id, + 'comment_type' => 'comment', + 'comment_approved' => 'spam', + ), + null + ); + + $this->assertSame( array( $expected_type, $expected_approved ), array( $data['comment_type'], $data['comment_approved'] ) ); + } + + /** + * Hook, post type, and the comment type and approval that should be stored. + * + * @return array + */ + public static function provide_note_type_cases() { + return array( + 'REST note' => array( 'rest_pre_insert_comment', 'feedback', Feedback::NOTE_COMMENT_TYPE, 0 ), + 'classic note' => array( 'preprocess_comment', 'feedback', Feedback::NOTE_COMMENT_TYPE, 0 ), + 'REST post comment' => array( 'rest_pre_insert_comment', 'post', 'comment', 'spam' ), + 'classic post reply' => array( 'preprocess_comment', 'post', 'comment', 'spam' ), + ); + } + + /** + * Core stores `comment_type` in a varchar(20) column, and MySQL rejects the whole insert when it's longer. + */ + public function test_note_comment_type_fits_core_column() { + $this->assertLessThanOrEqual( 20, strlen( Feedback::NOTE_COMMENT_TYPE ) ); + } + + /** + * Comment queries leave notes out unless they ask for them, so wp-admin's Comments screens never list or count them. + * + * @dataProvider provide_note_query_cases + * + * @param array $args Comment query arguments. + * @param bool $excluded Whether notes should be excluded. + */ + #[DataProvider( 'provide_note_query_cases' )] + public function test_comment_queries_exclude_feedback_notes( $args, $excluded ) { + Contact_Form_Plugin::init(); + $query = new \WP_Comment_Query(); + $query->parse_query( $args ); + + do_action_ref_array( 'pre_get_comments', array( &$query ) ); + + $this->assertSame( $excluded, in_array( Feedback::NOTE_COMMENT_TYPE, (array) $query->query_vars['type__not_in'], true ) ); + } + + /** + * Query arguments and whether notes should be excluded. + * + * @return array + */ + public static function provide_note_query_cases() { + return array( + 'default query' => array( array(), true ), + 'pending comments count' => array( + array( + 'status' => 'hold', + 'count' => true, + ), + true, + ), + 'other excluded types' => array( array( 'type__not_in' => array( 'pings' ) ), true ), + 'notes requested by type' => array( array( 'type' => Feedback::NOTE_COMMENT_TYPE ), false ), + 'notes in type__in' => array( array( 'type__in' => array( Feedback::NOTE_COMMENT_TYPE ) ), false ), + 'all types requested' => array( array( 'type' => 'all' ), false ), + ); + } + + /** + * Cache a comment so get_comment() finds it without a database. + * + * @param int $id Comment ID. + * @param string $type Comment type. + * @return \WP_Comment + */ + private function cache_comment( $id, $type ) { + $comment = new \WP_Comment( + (object) array( + 'comment_ID' => $id, + 'comment_post_ID' => 1, + 'comment_type' => $type, + 'comment_approved' => 'spam', + ) + ); + wp_cache_set( $id, $comment, 'comment' ); + + return $comment; + } + + /** + * A note marked as spam, e.g. by Akismet's bulk recheck, goes back on hold; other comments stay spam. + * + * @dataProvider provide_note_and_regular_comment + * + * @param string $type Comment type. + * @param bool $is_note Whether the comment is a note. + */ + #[DataProvider( 'provide_note_and_regular_comment' )] + public function test_feedback_notes_are_kept_out_of_spam( $type, $is_note ) { + Contact_Form_Plugin::init(); + $comment = $this->cache_comment( 9001, $type ); + $statuses = array(); + // Report the write as failed so core stops before re-reading the comment from a database we don't have. + $spy = function ( $result, $table, $data ) use ( &$statuses ) { + $statuses[] = $data['comment_approved'] ?? null; + return false; + }; + add_filter( 'wordbless_wpdb_update', $spy, 10, 3 ); + + do_action( 'transition_comment_status', 'spam', 'unapproved', $comment ); + remove_filter( 'wordbless_wpdb_update', $spy, 10 ); + + $this->assertSame( $is_note ? array( '0' ) : array(), $statuses ); + } + + /** + * A note and a regular comment. + * + * @return array + */ + public static function provide_note_and_regular_comment() { + return array( + 'note' => array( Feedback::NOTE_COMMENT_TYPE, true ), + 'regular comment' => array( 'comment', false ), + ); + } + + /** + * Moderators aren't emailed about held notes, but still are about other held comments. + * + * @dataProvider provide_note_and_regular_comment + * + * @param string $type Comment type. + * @param bool $is_note Whether the comment is a note. + */ + #[DataProvider( 'provide_note_and_regular_comment' )] + public function test_moderators_are_not_emailed_about_feedback_notes( $type, $is_note ) { + Contact_Form_Plugin::init(); + $this->cache_comment( 9002, $type ); + + $this->assertSame( ! $is_note, apply_filters( 'notify_moderator', true, 9002 ) ); + } + + /** + * Only people who manage responses can read one; wp-admin's Comments screen shows a note to anyone who can. + * + * @dataProvider provide_response_readers + * + * @param string $role Role of the user. + * @param bool $can_read Whether the user can read a published response. + */ + #[DataProvider( 'provide_response_readers' )] + public function test_only_response_managers_can_read_responses( $role, $can_read ) { + Contact_Form_Plugin::init(); + $feedback_id = wp_insert_post( + array( + 'post_type' => 'feedback', + 'post_status' => 'publish', + ) + ); + $user_id = wp_insert_user( + array( + 'user_login' => 'response_reader_' . $role, + 'user_pass' => 'password', + 'role' => $role, + ) + ); + + $this->assertSame( $can_read, user_can( $user_id, 'read_post', $feedback_id ) ); + } + + /** + * Roles and whether each can read a response. + * + * @return array + */ + public static function provide_response_readers() { + return array( + 'contributor' => array( 'contributor', false ), + 'author' => array( 'author', false ), + 'editor' => array( 'editor', true ), + ); + } + + /** + * The registered notes exporter and eraser run core's comment callbacks against notes only, and leave other queries alone after. + * + * @dataProvider provide_notes_privacy_callbacks + * + * @param string $register Contact_Form_Plugin method that registers the callback. + */ + #[DataProvider( 'provide_notes_privacy_callbacks' )] + public function test_notes_privacy_callbacks_query_notes_only( $register ) { + $plugin = Contact_Form_Plugin::init(); + $registered = $plugin->$register( array() ); + $types = array(); + $probe = function ( $query ) use ( &$types ) { + $types[] = $query->query_vars['type']; + }; + add_action( 'pre_get_comments', $probe, 6 ); + + call_user_func( $registered['jetpack-feedback-notes']['callback'], 'someone@example.com', 1 ); + get_comments( array( 'number' => 1 ) ); + remove_action( 'pre_get_comments', $probe, 6 ); + + $this->assertSame( array( Feedback::NOTE_COMMENT_TYPE, '' ), $types ); + } + + /** + * Privacy callbacks for notes. + * + * @return array + */ + public static function provide_notes_privacy_callbacks() { + return array( + 'exporter' => array( 'register_personal_data_exporter' ), + 'eraser' => array( 'register_personal_data_eraser' ), + ); + } + /** * Test track_feedback_status_change sets spam meta when transitioning to spam */