disable_captions filter-hookWP 2.6.0

Filters whether to disable captions.

Prevents image captions from being appended to image HTML when inserted into the editor.

Usage

add_filter( 'disable_captions', 'wp_kama_disable_captions_filter' );

/**
 * Function for `disable_captions` filter-hook.
 * 
 * @param bool $bool Whether to disable appending captions. Returning true from the filter will disable captions.
 *
 * @return bool
 */
function wp_kama_disable_captions_filter( $bool ){

	// filter...
	return $bool;
}
$bool(true|false)
Whether to disable appending captions. Returning true from the filter will disable captions.
Default: empty string

Changelog

Since 2.6.0 Introduced.

Where the hook is called

image_add_caption()
disable_captions
_WP_Editors::editor_settings()
disable_captions
wp_tinymce_inline_scripts()
disable_captions
wp_print_media_templates()
disable_captions
wp_enqueue_media()
disable_captions
media_upload_type_url_form()
disable_captions
wp_media_insert_url_form()
disable_captions
wp-admin/includes/media.php 216
if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {
wp-includes/class-wp-editor.php 556
if ( apply_filters( 'disable_captions', '' ) ) {
wp-includes/script-loader.php 493
if ( apply_filters( 'disable_captions', '' ) ) {
wp-includes/media-template.php 1019
if ( ! apply_filters( 'disable_captions', '' ) ) :
wp-includes/media-template.php 1082
if ( ! apply_filters( 'disable_captions', '' ) ) :
wp-includes/media.php 4412
'captions'          => ! apply_filters( 'disable_captions', '' ),
wp-admin/includes/media.php 2419
if ( ! apply_filters( 'disable_captions', '' ) ) {
wp-admin/includes/media.php 2898
if ( ! apply_filters( 'disable_captions', '' ) ) {

Where the hook is used in WordPress

Usage not found.