> 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 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://docs.stylemixthemes.com/masterstudy-lms/developers-guide/masterstudy-lms-hooks/certificate-builer.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.
