summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'themes/twentyfourteen/inc/customizer.php')
-rw-r--r--themes/twentyfourteen/inc/customizer.php110
1 files changed, 64 insertions, 46 deletions
diff --git a/themes/twentyfourteen/inc/customizer.php b/themes/twentyfourteen/inc/customizer.php
index 39289159..15314093 100644
--- a/themes/twentyfourteen/inc/customizer.php
+++ b/themes/twentyfourteen/inc/customizer.php
@@ -16,21 +16,27 @@
*/
function twentyfourteen_customize_register( $wp_customize ) {
// Add postMessage support for site title and description.
- $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
- $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
- $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) {
- $wp_customize->selective_refresh->add_partial( 'blogname', array(
- 'selector' => '.site-title a',
- 'container_inclusive' => false,
- 'render_callback' => 'twentyfourteen_customize_partial_blogname',
- ) );
- $wp_customize->selective_refresh->add_partial( 'blogdescription', array(
- 'selector' => '.site-description',
- 'container_inclusive' => false,
- 'render_callback' => 'twentyfourteen_customize_partial_blogdescription',
- ) );
+ $wp_customize->selective_refresh->add_partial(
+ 'blogname',
+ array(
+ 'selector' => '.site-title a',
+ 'container_inclusive' => false,
+ 'render_callback' => 'twentyfourteen_customize_partial_blogname',
+ )
+ );
+ $wp_customize->selective_refresh->add_partial(
+ 'blogdescription',
+ array(
+ 'selector' => '.site-description',
+ 'container_inclusive' => false,
+ 'render_callback' => 'twentyfourteen_customize_partial_blogdescription',
+ )
+ );
}
// Rename the label to "Site Title Color" because this only affects the site title in this theme.
@@ -49,31 +55,41 @@ function twentyfourteen_customize_register( $wp_customize ) {
}
// Add the featured content section in case it's not already there.
- $wp_customize->add_section( 'featured_content', array(
- 'title' => __( 'Featured Content', 'twentyfourteen' ),
- 'description' => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ),
- esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ),
- admin_url( 'edit.php?show_sticky=1' )
- ),
- 'priority' => 130,
- 'active_callback' => 'is_front_page',
- ) );
+ $wp_customize->add_section(
+ 'featured_content',
+ array(
+ 'title' => __( 'Featured Content', 'twentyfourteen' ),
+ 'description' => sprintf(
+ __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ),
+ esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ),
+ admin_url( 'edit.php?show_sticky=1' )
+ ),
+ 'priority' => 130,
+ 'active_callback' => 'is_front_page',
+ )
+ );
// Add the featured content layout setting and control.
- $wp_customize->add_setting( 'featured_content_layout', array(
- 'default' => 'grid',
- 'sanitize_callback' => 'twentyfourteen_sanitize_layout',
- ) );
+ $wp_customize->add_setting(
+ 'featured_content_layout',
+ array(
+ 'default' => 'grid',
+ 'sanitize_callback' => 'twentyfourteen_sanitize_layout',
+ )
+ );
- $wp_customize->add_control( 'featured_content_layout', array(
- 'label' => __( 'Layout', 'twentyfourteen' ),
- 'section' => 'featured_content',
- 'type' => 'select',
- 'choices' => array(
- 'grid' => __( 'Grid', 'twentyfourteen' ),
- 'slider' => __( 'Slider', 'twentyfourteen' ),
- ),
- ) );
+ $wp_customize->add_control(
+ 'featured_content_layout',
+ array(
+ 'label' => __( 'Layout', 'twentyfourteen' ),
+ 'section' => 'featured_content',
+ 'type' => 'select',
+ 'choices' => array(
+ 'grid' => __( 'Grid', 'twentyfourteen' ),
+ 'slider' => __( 'Slider', 'twentyfourteen' ),
+ ),
+ )
+ );
}
add_action( 'customize_register', 'twentyfourteen_customize_register' );
@@ -137,16 +153,18 @@ function twentyfourteen_contextual_help() {
return;
}
- get_current_screen()->add_help_tab( array(
- 'id' => 'twentyfourteen',
- 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ),
- 'content' =>
- '<ul>' .
- '<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' .
- '<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' .
- '<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' .
- '</ul>',
- ) );
+ get_current_screen()->add_help_tab(
+ array(
+ 'id' => 'twentyfourteen',
+ 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ),
+ 'content' =>
+ '<ul>' .
+ '<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' .
+ '<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' .
+ '<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' .
+ '</ul>',
+ )
+ );
}
add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' );
-add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' );
+add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' );