> For the complete documentation index, see [llms.txt](https://developers.disciple.tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.disciple.tools/theme-core/hooks/api-hooks.md).

# API-Hooks

Documentation for theme version 1.0.0 or greater

## Post Create

**dt\_create\_post\_check\_proceed** filter\
Extra permission check before the fields are processed\
Parameters 2: bool continue, array $fields

**dt\_post\_create\_fields** filter\
Add, remove or modify fields before the fields are processed.\
Parameters 2: array $fields, string $post\_type

**dt\_post\_create\_allow\_fields** filter\
Add extra field keys that are allowed. The API will reject requests with fields that are not declared or allowed\
Parameters 2: array $field\_keys, string $post\_type

*post created*\
\&#xNAN;*fields processed*

**dt\_post\_created** action\
Runs after post is created and fields are processed\
Parameters 3: string $post\_type, int $post\_id, array $initial\_request\_fields

## Update Post

**dt\_post\_update\_fields** filter\
Add, remove or modify fields before the fields are processed.\
Parameters 4: array $fields, string $post\_type, int $post\_id, array $existing\_post

**dt\_post\_create\_allow\_fields** filter\
Add extra field keys that are allowed. The API will reject requests with fields that are not declared or allowed\
Parameters 2: array $field\_keys, string $post\_type

*fields processed*

**dt\_post\_updated** action\
Runs after fields are processed\
Parameters 5: string $post\_type, int post\_id, array $initial\_request\_fields, array $post\_fields\_before\_update, array $post\_fields\_after\_update

## Get Post

**dt\_after\_get\_post\_fields\_filter** filter\
Add, modify or remove fields from the response\
Parameters 2: array $fields, string $post\_type

## Delete Post

**dt\_before\_post\_deleted** action\
Runs before a post is deleted, allowing you to inspect the post before it's deleted.\
Parameters 2: string $post\_type, int $post\_id

**dt\_post\_deleted** action\
Runs after post is deleted.\
Parameters 3: string $post\_type, int $post\_id, string $post\_title

## List Post

**dt\_search\_viewable\_posts\_query** filter\
Add or remove query parameters\
Parameters 1: array $query\_fields

**dt\_adjust\_post\_custom\_fields** filter\
Runs an each post in the query result. Add, remove, or modify the post fields Parameters 2: array $fields, string $post\_type

**dt\_list\_posts\_custom\_fields** filter\
Modify the response before the list of posts is returned.\
Parameters 2: array $request\_response, string $post\_type

## Comments

**dt\_comment\_created** Action\
Runs after a comment is created\
Parameters 4: string $post\_type, int $post\_id, int $created\_comment\_id, string $comment\_type

**dt\_filter\_post\_comments** Filter\
Modify the response before the list of comments is returned.\
Parameters 3: array $request\_body, sting $post\_type, int $post\_id


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.disciple.tools/theme-core/hooks/api-hooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
