disable_captions

disable_captions

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('disable_captions') is found 8 times:

  • /wp-admin/includes/media.php line 216

    *
    * @param bool $bool Whether to disable appending captions. Returning true from the filter
    * will disable captions. Default empty string.
    */
    if ( empty( $caption ) || apply_filters( ‘disable_captions’, ” ) ) {
    return $html;
    }

    $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) ) { [/php]

  • /wp-admin/includes/media.php line 2443
    2439
    2440
    2441
    2442
    2443
    2444
    2445
    2446
    2447
    2448
    2449
        alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
     
    <?php
    /** This filter is documented in wp-admin/includes/media.php */
    if ( ! apply_filters( 'disable_captions', '' ) ) {
        ?>
        if ( f.caption.value ) {
            caption = f.caption.value.replace(/\r\n|\r/g, '\n');
            caption = caption.replace(/<&#91;a-zA-Z0-9&#93;+( &#91;^<>]+)?>/g, function(a){
                return a.replace(/[\r\n\t]+/, ' ');
            });
  • /wp-admin/includes/media.php line 2927
    2923
    2924
    2925
    2926
    2927
    2928
    2929
    2930
    2931
    2932
    2933
    * @return string HTML content of the form.
     */
    function wp_media_insert_url_form( $default_view = 'image' ) {
        /** This filter is documented in wp-admin/includes/media.php */
        if ( ! apply_filters( 'disable_captions', '' ) ) {
            $caption = '
            <tr class="image-only">
                <th scope="row" class="label">
                    <label for="caption"><span class="alignleft">' . __( 'Image Caption' ) . '</span></label>
                </th>
                <td class="field"><textarea id="caption" name="caption"></textarea></td>
  • /wp-includes/class-wp-editor.php line 567
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
        $settings['external_plugins'] = wp_json_encode( $mce_external_plugins );
    }
     
    /** This filter is documented in wp-admin/includes/media.php */
    if ( apply_filters( 'disable_captions', '' ) ) {
        $settings['wpeditimage_disable_captions'] = true;
    }
     
    $mce_css = $settings['content_css'];
     
    /*
  • /wp-includes/media-template.php line 1081
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
     
    <?php
    /** This filter is documented in wp-admin/includes/media.php */
    if ( ! apply_filters( 'disable_captions', '' ) ) :
        ?>
        <span class="setting caption">
            <label for="embed-image-settings-caption" class="name"><?php _e( 'Caption' ); ?></label>
            <textarea id="embed-image-settings-caption" data-setting="caption"></textarea>
        </span>
    <?php endif; ?>
  • /wp-includes/media-template.php line 1144
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    <p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
     
    <?php
    /** This filter is documented in wp-admin/includes/media.php */
    if ( ! apply_filters( 'disable_captions', '' ) ) :
        ?>
        <span class="setting caption">
            <label for="image-details-caption" class="name"><?php _e( 'Caption' ); ?></label>
            <textarea id="image-details-caption" data-setting="caption">{{ data.model.caption }}</textarea>
        </span>
    <?php endif; ?>
  • /wp-includes/media.php line 4871
    4867
    4868
    4869
    4870
    4871
    4872
    4873
    4874
    4875
    4876
    4877
    'tabs'              => $tabs,
    'tabUrl'            => add_query_arg( array( 'chromeless' => true ), admin_url( 'media-upload.php' ) ),
    'mimeTypes'         => wp_list_pluck( get_post_mime_types(), 0 ),
    /** This filter is documented in wp-admin/includes/media.php */
    'captions'          => ! apply_filters( 'disable_captions', '' ),
    'nonce'             => array(
        'sendToEditor'           => wp_create_nonce( 'media-send-to-editor' ),
        'setAttachmentThumbnail' => wp_create_nonce( 'set-attachment-thumbnail' ),
    ),
    'post'              => array(
        'id' => 0,
  • /wp-includes/script-loader.php line 550
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    $disable_captions = false;
    // Runs after `tiny_mce_plugins` but before `mce_buttons`.
    /** This filter is documented in wp-admin/includes/media.php */
    if ( apply_filters( 'disable_captions', '' ) ) {
        $disable_captions = true;
    }
     
    $toolbar1 = array(
        'formatselect',
        'bold',