X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-content/themes/twentythirteen/functions.php
diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php
index 5474d07d..e87761f2 100644
--- a/wp-content/themes/twentythirteen/functions.php
+++ b/wp-content/themes/twentythirteen/functions.php
@@ -6,8 +6,8 @@
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
- * When using a child theme (see http://codex.wordpress.org/Theme_Development
- * and http://codex.wordpress.org/Child_Themes), you can override certain
+ * When using a child theme (see https://codex.wordpress.org/Theme_Development
+ * and https://codex.wordpress.org/Child_Themes), you can override certain
* functions (those wrapped in a function_exists() call) by defining them first
* in your child theme's functions.php file. The child theme's functions.php
* file is included before the parent theme's file, so the child theme
@@ -16,7 +16,7 @@
* Functions that are not pluggable (not wrapped in function_exists()) are
* instead attached to a filter or action hook.
*
- * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API
+ * For more information on hooks, actions, and filters, @link https://codex.wordpress.org/Plugin_API
*
* @package WordPress
* @subpackage Twenty_Thirteen
@@ -87,7 +87,7 @@ function twentythirteen_setup() {
/*
* This theme supports all available post formats by default.
- * See http://codex.wordpress.org/Post_Formats
+ * See https://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
@@ -146,7 +146,7 @@ function twentythirteen_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
- $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
+ $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
@@ -170,7 +170,7 @@ function twentythirteen_scripts_styles() {
wp_enqueue_script( 'jquery-masonry' );
// Loads JavaScript file with functionality specific to Twenty Thirteen.
- wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-06-08', true );
+ wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true );
// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
@@ -319,7 +319,7 @@ if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
*/
function twentythirteen_entry_meta() {
if ( is_sticky() && is_home() && ! is_paged() )
- echo '' . __( 'Sticky', 'twentythirteen' ) . '';
+ echo '' . esc_html__( 'Sticky', 'twentythirteen' ) . '';
if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
twentythirteen_entry_date();
@@ -413,7 +413,7 @@ function twentythirteen_the_attached_image() {
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
- 'orderby' => 'menu_order ID'
+ 'orderby' => 'menu_order ID',
) );
// If there is more than 1 attachment in a gallery...
@@ -431,7 +431,7 @@ function twentythirteen_the_attached_image() {
// or get the URL of the first image attachment.
else
- $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
+ $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
}
printf( '%3$s',
@@ -461,6 +461,27 @@ function twentythirteen_get_link_url() {
return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
}
+if ( ! function_exists( 'twentythirteen_excerpt_more' ) && ! is_admin() ) :
+/**
+ * Replaces "[...]" (appended to automatically generated excerpts) with ...
+ * and a Continue reading link.
+ *
+ * @since Twenty Thirteen 1.4
+ *
+ * @param string $more Default Read More excerpt link.
+ * @return string Filtered Read More excerpt link.
+ */
+function twentythirteen_excerpt_more( $more ) {
+ $link = sprintf( '%2$s',
+ esc_url( get_permalink( get_the_ID() ) ),
+ /* translators: %s: Name of current post */
+ sprintf( __( 'Continue reading %s →', 'twentythirteen' ), '' . get_the_title( get_the_ID() ) . '' )
+ );
+ return ' … ' . $link;
+}
+add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );
+endif;
+
/**
* Extend the default WordPress body classes.
*
@@ -526,6 +547,6 @@ add_action( 'customize_register', 'twentythirteen_customize_register' );
* @since Twenty Thirteen 1.0
*/
function twentythirteen_customize_preview_js() {
- wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
+ wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20141120', true );
}
add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );