# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
