namespace . '/forms'; $routes['api.admin.forms.published'] = $this->namespace . '/forms/published'; $routes['api.admin.forms.get'] = $this->namespace . '/forms/{form}'; $routes['api.admin.forms.create'] = $this->namespace . '/forms/create'; $routes['api.admin.forms.delete'] = $this->namespace . '/forms/{form}'; $routes['api.admin.forms.published-number'] = $this->namespace . '/forms/published-number'; $routes['api.admin.forms.name'] = $this->namespace . '/forms/{form}/name'; // @todo: move to form export controller instead. $routes['api.admin.forms.exports'] = $this->namespace . '/forms/{form}/exports'; $routes['api.admin.forms.submissions'] = $this->namespace . '/forms/{form}/submissions'; return $routes; } ); // api.admin.forms: GET epicforms/v1.0.0/admin/forms. register_rest_route( $this->namespace, '/forms', [ [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ Epicformbuilder_Handlers_REST_API_Forms_Get::class, 'callback' ], 'schema' => [ Epicformbuilder_Handlers_REST_API_Forms_Get::class, 'schema' ], 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, ], ] ); // api.admin.forms.published: GET epicforms/v1.0.0/admin/forms/published. register_rest_route( $this->namespace, '/forms/published', [ [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ Epicformbuilder_Handlers_REST_API_Forms_List_Published::class, 'callback' ], 'schema' => [ Epicformbuilder_Handlers_REST_API_Forms_List_Published::class, 'schema' ], 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, ], ] ); // api.admin.forms.published-number GET epicforms/v1.0.0/admin/forms/published-number. register_rest_route( $this->namespace, '/forms/published-number', [ [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ Epicformbuilder_Handlers_REST_API_Form_Get_Published_Number::class, 'callback' ], 'schema' => [ Epicformbuilder_Handlers_REST_API_Form_Get_Published_Number::class, 'schema' ], 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, ], ] ); // api.admin.forms.create POST epicforms/v1.0.0/admin/forms/create. register_rest_route( $this->namespace, '/forms/create', [ [ 'methods' => WP_REST_Server::CREATABLE, 'callback' => [ Epicformbuilder_Handlers_REST_API_Form_Create::class, 'callback' ], 'schema' => [ Epicformbuilder_Handlers_REST_API_Form_Create::class, 'schema' ], 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, ], ] ); // api.admin.form.update.part.name PATCH epicforms/v1.0.0/admin/forms/{form}/name. register_rest_route( $this->namespace, '/forms/(?P