---
url: /hooks/filters/wpce-asset-handle.md
description: >-
  Filter the script and stylesheet asset handles that WPCE automatically
  enqueues when elements appear on a page.
---

# `wpce_asset_handle`&#x20;

Filters the asset handles for an element type.

Asset handles are used to automatically enqueue element scripts/styles when they appear on a page.

## Parameters

1. `string $handle`

   The handle.

2. `string $element_id`

   The ID of the element type.

3. `string $type`

   What type of asset handle is being filtered. Either `"script"` or `"style"`.

## Example

```php
add_filter('wpce_asset_handle', function (string $handle, string $element_id, string $type) {
	return "wpce_{$element_id}_{$type}";
}, 10, 3);
```

## Related

* [`wpce_render`](./wpce-render)
