WordPress filter hook · part of WordPress core

disable_captions

A WordPress core filter that 9 plugins also fire themselves, running on 1.2M+ sites between them.

“This filter is documented in wp-admin/includes/media.php”

How to use disable_captions

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'disable_captions', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Complianz GDPR/CCPA Cookie Consent Banner's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire disable_captions

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Complianz GDPR/CCPA Cookie Consent Banner icon Complianz GDPR/CCPA Cookie Consent Banner1+ million installs apply_filters( 'disable_captions', '' ) settings/media/wp_enqueue_media_override.php:115
  2. Burst Statistics icon Burst Statistics200,000+ installs apply_filters( 'disable_captions', '' ) includes/Admin/App/media/media-override.php:140
  3. File Un-Attach icon File Un-Attach300+ installs apply_filters( 'disable_captions', '' ) inc/media-template.3.9.php:503
  4. Media Manager Plus icon Media Manager Plus100+ installs apply_filters( 'disable_captions', '' ) uber-media.php:662
  5. Used Media Identifier icon Used Media Identifier10+ installs apply_filters( 'disable_captions', '' ) admin/class-used-media-identifier-admin.php:873
  6. Volusion icon Volusion10+ installs apply_filters( 'disable_captions', '' ) media-process.php:6
  7. NetAngels Cloud Storage icon NetAngels Cloud Storage10+ installs apply_filters( 'disable_captions', '' ) netangelss3.php:505
  8. Media Insert from Themes Dir icon Media Insert from Themes Dir10+ installs apply_filters( 'disable_captions', '' ) media-insert-from-themes-dir.php:252
  9. Coyote icon CoyoteFewer than 10 installs apply_filters( 'disable_captions', '' ) php/media-template.php:819

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.