controllers() as $controller ) { $controller->register_routes(); } } /** * Returns the registered controllers. * * @return array The controllers. */ public function controllers(): array { $controllers = array( $this->forms, $this->entries, $this->submission, ); /** * Filters the REST controllers the plugin registers. * * @since 1.0.0 * * @param array $controllers Controllers to register. */ $controllers = (array) apply_filters( 'formpilot_rest_controllers', $controllers ); return array_values( array_filter( $controllers, static fn( $controller ): bool => $controller instanceof WP_REST_Controller ) ); } }