On this page
apply_filters( 'disable_captions', bool $bool )
Filters whether to disable captions.
Description
Prevents image captions from being appended to image HTML when inserted into the editor.
Parameters
$boolbool-
Whether to disable appending captions. Returning true from the filter will disable captions. Default empty string.
Source
File: wp-admin/includes/media.php. View all references
if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {
Related
Used By
| Used By | Description |
|---|---|
| wp_tinymce_inline_scripts() wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| media_upload_type_url_form() wp-admin/includes/media.php | Outputs the legacy media upload form for external media. |
| wp_media_insert_url_form() wp-admin/includes/media.php | Creates the form for external url. |
| image_add_caption() wp-admin/includes/media.php | Adds image shortcode with caption to editor. |
| wp_enqueue_media() wp-includes/media.php | Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
| _WP_Editors::editor_settings() wp-includes/class-wp-editor.php | |
| wp_print_media_templates() wp-includes/media-template.php | Prints the templates used in the media manager. |
Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/disable_captions