~canonical-sysadmins/wordpress/4.4.2

« back to all changes in this revision

Viewing changes to wp-content/themes/twentysixteen/functions.php

  • Committer: Barry Price
  • Date: 2016-01-07 06:09:42 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: barry.price@canonical.com-20160107060942-1ghv2tqiwm8z0j36
Merge WP4.4.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
         * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
71
71
         */
72
72
        add_theme_support( 'post-thumbnails' );
73
 
        set_post_thumbnail_size( 1200, 0, true );
 
73
        set_post_thumbnail_size( 1200, 9999 );
74
74
 
75
75
        // This theme uses wp_nav_menu() in two locations.
76
76
        register_nav_menus( array(
239
239
        wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() );
240
240
 
241
241
        // Load the Internet Explorer specific stylesheet.
242
 
        wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20150825' );
 
242
        wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20150930' );
243
243
        wp_style_add_data( 'twentysixteen-ie', 'conditional', 'lt IE 10' );
244
244
 
245
245
        // Load the Internet Explorer 8 specific stylesheet.
246
 
        wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20150825' );
 
246
        wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20151230' );
247
247
        wp_style_add_data( 'twentysixteen-ie8', 'conditional', 'lt IE 9' );
248
248
 
249
249
        // Load the Internet Explorer 7 specific stylesheet.
250
 
        wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20150825' );
 
250
        wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20150930' );
251
251
        wp_style_add_data( 'twentysixteen-ie7', 'conditional', 'lt IE 8' );
252
252
 
253
253
        // Load the html5 shiv.
254
254
        wp_enqueue_script( 'twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );
255
255
        wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' );
256
256
 
257
 
        wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20150825', true );
 
257
        wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151112', true );
258
258
 
259
259
        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
260
260
                wp_enqueue_script( 'comment-reply' );
261
261
        }
262
262
 
263
263
        if ( is_singular() && wp_attachment_is_image() ) {
264
 
                wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20150825' );
 
264
                wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20151104' );
265
265
        }
266
266
 
267
 
        wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150825', true );
 
267
        wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20151204', true );
268
268
 
269
269
        wp_localize_script( 'twentysixteen-script', 'screenReaderText', array(
270
270
                'expand'   => __( 'expand child menu', 'twentysixteen' ),
389
389
        return $attr;
390
390
}
391
391
add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10 , 3 );
 
392
 
 
393
/**
 
394
 * Modifies tag cloud widget arguments to have all tags in the widget same font size.
 
395
 *
 
396
 * @since Twenty Sixteen 1.1
 
397
 *
 
398
 * @param array $args Arguments for tag cloud widget.
 
399
 * @return array A new modified arguments.
 
400
 */
 
401
function twentysixteen_widget_tag_cloud_args( $args ) {
 
402
        $args['largest'] = 1;
 
403
        $args['smallest'] = 1;
 
404
        $args['unit'] = 'em';
 
405
        return $args;
 
406
}
 
407
add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' );