> For the complete documentation index, see [llms.txt](https://tigriweb.gitbook.io/packaging-fit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tigriweb.gitbook.io/packaging-fit/development/filters.md).

# Filters

### **tw**p&#x66;**\_global\_options**

Modify global options for the plugin. This filter allows you to customize the default settings used throughout the plugin.

```php
add_filter( 'twpf_global_options', 'twpf_custom_global_options' );
function twpf_custom_global_options( $options ) {
	// Modify global options
	$options['min_weight'] = 0.5;

	return $options;
}
```

### **tw**p&#x66;**\_menu\_capability**

Customize the capability required to access the menu. This filter allows you to control which user roles can access the `Packaging Fit` settings.

```php
add_filter( 'twpf_menu_capability', 'twpf_custom_menu_capability' );
function twpf_custom_menu_capability( $capability ) {
	return 'manage_woocommerce';
}
```

### **tw**p&#x66;**\_menu\_title**

Customize the menu title. Use this filter to change the text displayed in the WordPress admin menu.

```php
add_filter( 'twpf_menu_title', 'twpf_custom_menu_title' );
function twpf_custom_menu_title( $title ) {
	return __( 'Custom Packaging Fit Title', 'theme_name' );
}
```

### twpf\_prepare\_api\_request\_data

`@since 1.0.2`

Filters the data sent to the Packaging Fit API before making the request.

```php
add_filter( 'twpf_prepare_api_request_data', 'twpf_custom_prepare_api_request_data', 10, 2 );
function twpf_custom_prepare_api_request_data( $response_data, $order ) {
	// To capture debug information, use the code below.
	// If debugging is not needed, this code should be removed.
	ob_start();

	echo '<pre>';
	var_dump( $response_data );
	var_dump( $order->get_ID() );
	var_dump( $order->get_billing_postcode() );
	echo '</pre>';

	return array( 'debug' => ob_get_clean() );
	// End of debug information capture.

	// Change data here.



	return $response_data;
}
```
