> For the complete documentation index, see [llms.txt](https://docs.stylemixthemes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stylemixthemes.com/masterstudy-lms/developers-guide/masterstudy-lms-hooks/certificate-builer.md).

# Certificate Builer

The [**Certificate Builder**](/masterstudy-lms/lms-pro-addons/certificate-builder.md) addon provides filters that let you customize the fields displayed on certificates and control the data used in certificate rendering. Use these hooks to add, modify, or remove certificate field values.

## Filters

1. `stm_certificates_fields`

**Type:** filter\
**What it does:** lets you modify the default fields shown when editing the certificate preview\
**Parameters:**

* `$fields` (array) list of field definitions

**Return:** array of updated fields

**Example:**

```php
add_filter( 'stm_certificates_fields', 'stm_certificates_fields_function' );

function stm_certificates_fields_function( $fields ) {
$user_id = get_current_user_id();
if ( $user_id == 33 ) {
    $fields['course_name'] = array(
       'name'  => 'Course name',
       'value' => '-Course name-',
    );
}

return $fields;
}
```

2. `masterstudy_lms_certificate_fields_data`

**Type:** filter\
**What it does:** allows customization of the internal values of the certificate\
**Parameters:**

* `$fields` (array) list of certificate data values
* `$certificate` (array) current certificate data

**Return:** array of updated certificate data

**Example:**

```php
add_filter( 'masterstudy_lms_certificate_fields_data', 'masterstudy_lms_certificate_fields_data_function', 10, 2 );

function masterstudy_lms_certificate_fields_data_function( $fields, $certificate ) {
	$user_id = get_current_user_id();
	if ( $user_id == 1 ) {
		$fields[] = array( 'content' => 'Custom course name' );
	}
	return $fields;
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stylemixthemes.com/masterstudy-lms/developers-guide/masterstudy-lms-hooks/certificate-builer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
