Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-includes/media.php

    r23140 r23317  
    736736    $itemtag = tag_escape($itemtag);
    737737    $captiontag = tag_escape($captiontag);
     738    $icontag = tag_escape($icontag);
     739    $valid_tags = wp_kses_allowed_html( 'post' );
     740    if ( ! isset( $valid_tags[ $itemtag ] ) )
     741        $itemtag = 'dl';
     742    if ( ! isset( $valid_tags[ $captiontag ] ) )
     743        $captiontag = 'dd';
     744    if ( ! isset( $valid_tags[ $icontag ] ) )
     745        $icontag = 'dt';
     746
    738747    $columns = intval($columns);
    739748    $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
     
    13921401
    13931402                // We have the actual image size, but might need to further constrain it if content_width is narrower.
    1394                 // This is not necessary for thumbnails and medium size.
    1395                 if ( 'thumbnail' == $size || 'medium' == $size ) {
    1396                     $width = $size_meta['width'];
    1397                     $height = $size_meta['height'];
    1398                 } else {
    1399                     list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' );
    1400                 }
     1403                // Thumbnail, medium, and full sizes are also checked against the site's height/width options.
     1404                list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' );
    14011405
    14021406                $sizes[ $size ] = array(
     
    14321436 */
    14331437function wp_enqueue_media( $args = array() ) {
     1438
     1439    // Enqueue me just once per page, please.
     1440    if ( did_action( 'wp_enqueue_media' ) )
     1441        return;
     1442
    14341443    $defaults = array(
    14351444        'post' => null,
     
    14491458    $tabs = apply_filters( 'media_upload_tabs', $tabs );
    14501459    unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
     1460
     1461    $props = array(
     1462        'link'  => get_option( 'image_default_link_type' ), // db default is 'file'
     1463        'align' => get_option( 'image_default_align' ), // empty default
     1464        'size'  => get_option( 'image_default_size' ),  // empty default
     1465    );
    14511466
    14521467    $settings = array(
     
    14611476            'id' => 0,
    14621477        ),
     1478        'defaultProps' => $props,
    14631479    );
    14641480
Note: See TracChangeset for help on using the changeset viewer.