namespace, '/dashboard/stats', array( array( 'methods' => 'GET', 'callback' => array( $this, 'stats' ), 'permission_callback' => array( $this, 'can_read' ), ), ) ); } /** * @param WP_REST_Request $request The request. */ public function stats( WP_REST_Request $request ): WP_REST_Response { unset( $request ); /** * The dashboard's figures. * * Each module adds what it owns. Nothing is required, and a module that contributes * nothing simply has no tile. * * @param array $stats Contributed statistics, keyed by module. */ $stats = (array) apply_filters( 'plugixa_crm_dashboard_stats', array() ); return $this->ok( $stats ); } }