Make WordPress Core

Changeset 27302


Ignore:
Timestamp:
02/26/2014 10:19:11 PM (11 years ago)
Author:
nacin
Message:

Introduce HTML5 gallery support.

When a theme supports HTML5 galleries via add_theme_support( 'html5', 'gallery' ), figure and figcaption will be used instead of definition list markup.

props obenland.
fixes #26697.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r27269 r27302  
    763763 *                              Accepts any valid SQL ORDERBY statement.
    764764 *     @type int    $id         Post ID.
    765  *     @type string $itemtag    HTML tag to use for each image in the gallery. Default 'dl'.
    766  *     @type string $icontag    HTML tag to use for each image's icon. Default 'dt'.
    767  *     @type string $captiontag HTML tag to use for each image's caption. Default 'dd'.
     765 *     @type string $itemtag    HTML tag to use for each image in the gallery.
     766 *                              Default 'dl', or 'figure' when the theme registers HTML5 gallery support.
     767 *     @type string $icontag    HTML tag to use for each image's icon.
     768 *                              Default 'dt', or 'div' when the theme registers HTML5 gallery support.
     769 *     @type string $captiontag HTML tag to use for each image's caption.
     770 *                              Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support.
    768771 *     @type int    $columns    Number of columns of images to display. Default 3.
    769772 *     @type string $size       Size of the images to display. Default 'thumbnail'.
     
    813816    }
    814817
     818    $html5 = current_theme_supports( 'html5', 'gallery' );
    815819    extract(shortcode_atts(array(
    816820        'order'      => 'ASC',
    817821        'orderby'    => 'menu_order ID',
    818822        'id'         => $post ? $post->ID : 0,
    819         'itemtag'    => 'dl',
    820         'icontag'    => 'dt',
    821         'captiontag' => 'dd',
     823        'itemtag'    => $html5 ? 'figure'     : 'dl',
     824        'icontag'    => $html5 ? 'div'        : 'dt',
     825        'captiontag' => $html5 ? 'figcaption' : 'dd',
    822826        'columns'    => 3,
    823827        'size'       => 'thumbnail',
Note: See TracChangeset for help on using the changeset viewer.