data->user_can_view_content[ $key ] = [ 'user_can_view' => $user_can_view, 'post_id' => $post_id, 'restrictions' => $restrictions, 'context' => \ContentControl\current_query_context(), ]; return $user_can_view; } /** * Listen for restrict_main_query action. * * @param \ContentControl\Models\Restriction $restriction Restriction. * * @return void */ public function action_restrict_main_query( $restriction ) { $this->data->main_query_restriction = $restriction; } /** * Listen for restrict_main_query action. * * @param \ContentControl\Models\Restriction $restriction Restriction. * @param int[] $post_ids Post IDs. * * @return void */ public function action_restrict_main_query_post( $restriction, $post_ids ) { $this->data->restrict_main_query_posts[] = [ 'restriction' => $restriction, 'post_ids' => $post_ids, ]; } /** * Data to expose on the Query Monitor debug bar. * * @return void */ public function process() { } }