---
id: gk-block-mcp-media-uploads-enabled
title: "Filter - gk/block-mcp/media/uploads-enabled"
sidebar_label: "gk/block-mcp/media/uploads-enabled"
tags:
  - "2.0.0"
---

# Filter: gk/block-mcp/media/uploads-enabled

Flip the AI's media library access to read-only in one line.

There's a setting for this, but the filter is the emergency brake: it wins over the stored option and needs no database write, so you can shut off every MCP upload instantly — from code, a must-use plugin, or an incident-response hook — the moment a token looks compromised or a policy says "no agent-uploaded files." Return false to refuse all uploads (multipart, URL sideload, and base64) with a clean 403.

## Parameters

| Name | Type | Description |
|------|------|-------------|
| $enabled | `bool` | Whether uploads are currently allowed by the stored option. |

## Example

// Make the media library read-only for the AI agent.

```php
add_filter( 'gk/block-mcp/media/uploads-enabled', '__return_false' );
```

### Since

- [2.0.0](../../since/2-0-0/)

### Source

Defined in `wordpress-plugin/gk-block-api/includes/class-media-manager.php` at line 100

