Make WordPress Core

Ticket #31467: 31467-3.patch

File 31467-3.patch, 1.9 KB (added by eherman24, 10 years ago)

Sets image_default_link_type to none on install. Removed "selected" from file option field and added it to none. Puts "none" in first place in the dropdown, making it the default for images. Introduces new filter to allow override of image_default_link_type.

  • wp-admin/includes/schema.php

     
    461461        // 2.7
    462462        'large_size_w' => 1024,
    463463        'large_size_h' => 1024,
    464         'image_default_link_type' => 'file',
     464        'image_default_link_type' => 'none',
    465465        'image_default_size' => '',
    466466        'image_default_align' => '',
    467467        'close_comments_for_old_posts' => 0,
  • wp-includes/media-template.php

     
    648648                                        </option>
    649649                                        <option value="file">
    650650                                <# } else { #>
    651                                         <option value="file" selected>
     651                                        <option value="none" selected>
     652                                                <?php esc_attr_e('None'); ?>
     653                                        </option>
     654                                        <option value="file">
    652655                                <# } #>
    653656                                        <# if ( data.model.canEmbed ) { #>
    654657                                                <?php esc_attr_e('Link to Media File'); ?>
     
    667670                                        <option value="custom">
    668671                                                <?php esc_attr_e('Custom URL'); ?>
    669672                                        </option>
    670                                         <option value="none">
    671                                                 <?php esc_attr_e('None'); ?>
    672                                         </option>
    673673                                <# } #>
    674674                                </select>
    675675                        </label>
  • wp-includes/media.php

     
    29012901        unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
    29022902
    29032903        $props = array(
    2904                 'link'  => get_option( 'image_default_link_type' ), // db default is 'file'
     2904                'link'  => apply_filters( 'image_default_link_type' , 'none' ), // 'none' by default ( possible options : none, file, post, custom )
    29052905                'align' => get_option( 'image_default_align' ), // empty default
    29062906                'size'  => get_option( 'image_default_size' ),  // empty default
    29072907        );