get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
// Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
$wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'alovernat' );
}
add_action( 'customize_register', 'alovernat_customize_register' );
/**
* Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
*
* @since Alovernat 1.0
*/
function alovernat_customize_preview_js() {
wp_enqueue_script( 'alovernat_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20141027', true );
}
add_action( 'customize_preview_init', 'alovernat_customize_preview_js' );
/**
* Add contextual help to the Themes and Post edit screens.
*
* @since Alovernat 1.0
*/
function alovernat_contextual_help() {
if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) {
return;
}
get_current_screen()->add_help_tab( array(
'id' => 'alovernat',
'title' => __( 'Alovernat', 'alovernat' ),
'content' =>
'
' .
'- ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'alovernat' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'alovernat' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
' .
'- ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Alovernat uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'alovernat' ), 'http://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
' .
'- ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Alovernat documentation.', 'alovernat' ), '#' ) . '
' .
'
',
) );
}
add_action( 'admin_head-themes.php', 'alovernat_contextual_help' );
add_action( 'admin_head-edit.php', 'alovernat_contextual_help' );