---
title: "lzb/controls/all"
description: "PHP filter `lzb/controls/all` of the Lazy Blocks WordPress plugin."
url: "https://www.lazyblocks.com/docs/php-filters/lzb-controls-all/"
lastUpdated: 2026-09-09
source: "php-filters/lzb-controls-all.mdx"
---
# lzb/controls/all

Registers a control type, or changes one that already exists, which is the single place the block builder's control list comes from.

The default value is an empty array. Every built-in control adds itself here from its own class, keyed by its type slug, on `lzb/init` at priority 5. Nothing else builds the list, so a handler that returns something other than the array it was given removes every control from the block builder and drops every control from every block, because `prepare_block_controls()` silently discards a control whose `type` it cannot find.

## Attributes

| Name        | Type      | Description                                     |
| ----------- | --------- | ----------------------------------------------- |
| `$controls` | **Array** | control definitions, keyed by control type slug |

Each entry holds these keys:

| Key            | Type       | Description                                                                                               |
| -------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
| `name`         | **String** | type slug, the same as the array key                                                                      |
| `icon`         | **String** | SVG markup shown in the control picker                                                                    |
| `type`         | **String** | attribute type, one of `string`, `number`, `boolean`, `array`, `object`                                   |
| `label`        | **String** | control name shown in the block builder                                                                   |
| `category`     | **String** | grouping in the control picker, see [lzb/controls/categories](https://www.lazyblocks.com/docs/php-filters/lzb-controls-categories/) |
| `restrictions` | **Array**  | which settings the block builder offers for this control                                                  |
| `attributes`   | **Array**  | defaults merged into every control of this type                                                           |

## Usage

```php title="PHP"
function my_lzb_controls_all( $controls ) {
  // Keep the Code Editor control out of the block builder for everyone
  // who cannot edit files, and move Number next to Text.
  if ( ! current_user_can( 'edit_themes' ) ) {
    unset( $controls['code_editor'] );
  }

  if ( isset( $controls['number'] ) ) {
    $controls['number']['category'] = 'basic';
  }

  return $controls;
}

add_filter( 'lzb/controls/all', 'my_lzb_controls_all', 11 );
```

Use priority 11 or later. The built-in controls register at the default priority 10, so a handler at 10 or below sees a list that is still being filled. Removing a type that blocks already use makes those controls vanish from the blocks as well, not only from the picker, and the attributes behind them stop being registered.

Adding a control type of your own is covered in [Create Custom Control](https://www.lazyblocks.com/docs/examples/create-custom-control/), which subclasses `LazyBlocks_Control` and lets the base class hook this filter for you.

## Documentation Index
> Fetch the complete documentation index at: https://www.lazyblocks.com/llms.txt
> Fetch every page in a single file at: https://www.lazyblocks.com/llms-full.txt
