Merge master

This commit is contained in:
Ben Word
2015-01-09 19:09:46 -06:00
19 changed files with 89 additions and 75 deletions

View File

@@ -1,3 +1,11 @@
### 7.0.3: December 18th, 2014
* Use `get_the_archive_title`
* Remove `wp_title`, add title-tag theme support
* Remove `Roots_Nav_Walker` as default for all menus
* Update to Bootstrap 3.3.1
* Add some base comment styling
* Make search tearm `required` in search form
### 7.0.2: October 24th, 2014 ### 7.0.2: October 24th, 2014
* Simplify comments, use core comment form and list * Simplify comments, use core comment form and list
* Remove HTML5 shiv from Modernizr build * Remove HTML5 shiv from Modernizr build

View File

@@ -0,0 +1,19 @@
.comment-list {
&:extend(.list-unstyled all);
}
.comment-list ol {
list-style: none;
}
.comment-form p {
&:extend(.form-group all);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
&:extend(.form-control all);
}
.comment-form input[type="submit"] {
&:extend(.btn all);
&:extend(.btn-primary all);
}

View File

@@ -4,7 +4,7 @@
} }
.wp-caption-text { .wp-caption-text {
&:extend(.thumbnail .caption); &:extend(.thumbnail .caption all);
} }
// Gallery shortcode // Gallery shortcode

View File

@@ -8,6 +8,7 @@
// Roots // Roots
@import "_global"; // Base styling & custom mixins @import "_global"; // Base styling & custom mixins
@import "components/_buttons"; // Button tweaks @import "components/_buttons"; // Button tweaks
@import "components/_comments"; // Comment styling
@import "components/_forms"; // Form tweaks @import "components/_forms"; // Form tweaks
@import "components/_media"; // WordPress media @import "components/_media"; // WordPress media
@import "components/_wp-classes"; // WordPress generated classes @import "components/_wp-classes"; // WordPress generated classes

View File

@@ -1,6 +1,6 @@
{ {
"name": "roots", "name": "roots",
"version": "7.0.2", "version": "7.0.3",
"homepage": "http://roots.io", "homepage": "http://roots.io",
"authors": [ "authors": [
"Ben Word <ben@benword.com>" "Ben Word <ben@benword.com>"

View File

@@ -15,7 +15,7 @@ function roots_theme_activation_options_init() {
} }
add_action('admin_init', 'roots_theme_activation_options_init'); add_action('admin_init', 'roots_theme_activation_options_init');
function roots_activation_options_page_capability($capability) { function roots_activation_options_page_capability() {
return 'edit_theme_options'; return 'edit_theme_options';
} }
add_filter('option_page_capability_roots_activation_options', 'roots_activation_options_page_capability'); add_filter('option_page_capability_roots_activation_options', 'roots_activation_options_page_capability');
@@ -24,7 +24,7 @@ function roots_theme_activation_options_add_page() {
$roots_activation_options = roots_get_theme_activation_options(); $roots_activation_options = roots_get_theme_activation_options();
if (!$roots_activation_options) { if (!$roots_activation_options) {
$theme_page = add_theme_page( add_theme_page(
__('Theme Activation', 'roots'), __('Theme Activation', 'roots'),
__('Theme Activation', 'roots'), __('Theme Activation', 'roots'),
'edit_theme_options', 'edit_theme_options',
@@ -141,7 +141,7 @@ function roots_theme_activation_action() {
'post_type' => 'page' 'post_type' => 'page'
); );
$result = wp_insert_post($add_default_pages); wp_insert_post($add_default_pages);
} }
$home = get_page_by_title(__('Home', 'roots')); $home = get_page_by_title(__('Home', 'roots'));

View File

@@ -34,31 +34,36 @@ add_filter('body_class', 'roots_sidebar_body_class');
* See lib/sidebar.php for more details * See lib/sidebar.php for more details
*/ */
function roots_display_sidebar() { function roots_display_sidebar() {
$sidebar_config = new Roots_Sidebar( static $display;
/**
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
* Any of these conditional tags that return true won't show the sidebar
*
* To use a function that accepts arguments, use the following format:
*
* array('function_name', array('arg1', 'arg2'))
*
* The second element must be an array even if there's only 1 argument.
*/
array(
'is_404',
'is_front_page'
),
/**
* Page template checks (via is_page_template())
* Any of these page templates that return true won't show the sidebar
*/
array(
'template-custom.php'
)
);
return apply_filters('roots/display_sidebar', $sidebar_config->display); if (!isset($display)) {
$sidebar_config = new Roots_Sidebar(
/**
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
* Any of these conditional tags that return true won't show the sidebar
*
* To use a function that accepts arguments, use the following format:
*
* array('function_name', array('arg1', 'arg2'))
*
* The second element must be an array even if there's only 1 argument.
*/
array(
'is_404',
'is_front_page'
),
/**
* Page template checks (via is_page_template())
* Any of these page templates that return true won't show the sidebar
*/
array(
'template-custom.php'
)
);
$display = apply_filters('roots/display_sidebar', $sidebar_config->display);
}
return $display;
} }
/** /**

View File

@@ -2,21 +2,7 @@
/** /**
* Clean up the_excerpt() * Clean up the_excerpt()
*/ */
function roots_excerpt_more($more) { function roots_excerpt_more() {
return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>'; return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>';
} }
add_filter('excerpt_more', 'roots_excerpt_more'); add_filter('excerpt_more', 'roots_excerpt_more');
/**
* Manage output of wp_title()
*/
function roots_wp_title($title) {
if (is_feed()) {
return $title;
}
$title .= get_bloginfo('name');
return $title;
}
add_filter('wp_title', 'roots_wp_title', 10);

View File

@@ -123,7 +123,6 @@ if (current_theme_supports('bootstrap-gallery')) {
* Add class="thumbnail img-thumbnail" to attachment items * Add class="thumbnail img-thumbnail" to attachment items
*/ */
function roots_attachment_link_class($html) { function roots_attachment_link_class($html) {
$postid = get_the_ID();
$html = str_replace('<a', '<a class="thumbnail img-thumbnail"', $html); $html = str_replace('<a', '<a class="thumbnail img-thumbnail"', $html);
return $html; return $html;
} }

View File

@@ -7,6 +7,10 @@ function roots_setup() {
// Community translations can be found at https://github.com/roots/roots-translations // Community translations can be found at https://github.com/roots/roots-translations
load_theme_textdomain('roots', get_template_directory() . '/lang'); load_theme_textdomain('roots', get_template_directory() . '/lang');
// Enable plugins to manage the document title
// http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
add_theme_support('title-tag');
// Register wp_nav_menu() menus // Register wp_nav_menu() menus
// http://codex.wordpress.org/Function_Reference/register_nav_menus // http://codex.wordpress.org/Function_Reference/register_nav_menus
register_nav_menus(array( register_nav_menus(array(

View File

@@ -74,6 +74,8 @@ add_filter('nav_menu_item_id', '__return_null');
* Use Roots_Nav_Walker() by default * Use Roots_Nav_Walker() by default
*/ */
function roots_nav_menu_args($args = '') { function roots_nav_menu_args($args = '') {
$roots_nav_menu_args = array();
$roots_nav_menu_args['container'] = false; $roots_nav_menu_args['container'] = false;
if (!$args['items_wrap']) { if (!$args['items_wrap']) {
@@ -84,10 +86,6 @@ function roots_nav_menu_args($args = '') {
$roots_nav_menu_args['depth'] = 2; $roots_nav_menu_args['depth'] = 2;
} }
if (!$args['walker']) {
$roots_nav_menu_args['walker'] = new Roots_Nav_Walker();
}
return array_merge($args, $roots_nav_menu_args); return array_merge($args, $roots_nav_menu_args);
} }
add_filter('wp_nav_menu_args', 'roots_nav_menu_args'); add_filter('wp_nav_menu_args', 'roots_nav_menu_args');

View File

@@ -10,23 +10,7 @@ function roots_title() {
return __('Latest Posts', 'roots'); return __('Latest Posts', 'roots');
} }
} elseif (is_archive()) { } elseif (is_archive()) {
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); return get_the_archive_title();
if ($term) {
return apply_filters('single_term_title', $term->name);
} elseif (is_post_type_archive()) {
return apply_filters('the_title', get_queried_object()->labels->name);
} elseif (is_day()) {
return sprintf(__('Daily Archives: %s', 'roots'), get_the_date());
} elseif (is_month()) {
return sprintf(__('Monthly Archives: %s', 'roots'), get_the_date('F Y'));
} elseif (is_year()) {
return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
} elseif (is_author()) {
$author = get_queried_object();
return sprintf(__('Author Archives: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
} else {
return single_cat_title('', false);
}
} elseif (is_search()) { } elseif (is_search()) {
return sprintf(__('Search Results for %s', 'roots'), get_search_query()); return sprintf(__('Search Results for %s', 'roots'), get_search_query());
} elseif (is_404()) { } elseif (is_404()) {

View File

@@ -8,7 +8,7 @@ function is_element_empty($element) {
} }
// Tell WordPress to use searchform.php from the templates/ directory // Tell WordPress to use searchform.php from the templates/ directory
function roots_get_search_form($form) { function roots_get_search_form() {
$form = ''; $form = '';
locate_template('/templates/searchform.php', true, false); locate_template('/templates/searchform.php', true, false);
return $form; return $form;

View File

@@ -15,7 +15,13 @@ function roots_sidebar_path() {
class Roots_Wrapping { class Roots_Wrapping {
// Stores the full path to the main template file // Stores the full path to the main template file
static $main_template; public static $main_template;
// basename of template file
public $slug;
// array of templates
public $templates;
// Stores the base name of the template file; e.g. 'page' for 'page.php' etc. // Stores the base name of the template file; e.g. 'page' for 'page.php' etc.
static $base; static $base;
@@ -36,6 +42,11 @@ class Roots_Wrapping {
} }
static function wrap($main) { static function wrap($main) {
// Check for other filters returning null
if (!is_string($main)) {
return $main;
}
self::$main_template = $main; self::$main_template = $main;
self::$base = basename(self::$main_template, '.php'); self::$base = basename(self::$main_template, '.php');

View File

@@ -1,6 +1,6 @@
{ {
"name": "roots", "name": "roots",
"version": "7.0.2", "version": "7.0.3",
"author": "Ben Word <ben@benword.com>", "author": "Ben Word <ben@benword.com>",
"homepage": "http://roots.io", "homepage": "http://roots.io",
"repository": { "repository": {

View File

@@ -2,7 +2,7 @@
Theme Name: Roots Starter Theme Theme Name: Roots Starter Theme
Theme URI: http://roots.io/starter-theme/ Theme URI: http://roots.io/starter-theme/
Description: Roots is a WordPress starter theme based on HTML5 Boilerplate & Bootstrap. <a href="https://github.com/roots/roots/contributors">Contribute on GitHub</a> Description: Roots is a WordPress starter theme based on HTML5 Boilerplate & Bootstrap. <a href="https://github.com/roots/roots/contributors">Contribute on GitHub</a>
Version: 7.0.2 Version: 7.0.3
Author: Roots Author: Roots
Author URI: http://roots.io/ Author URI: http://roots.io/

View File

@@ -3,10 +3,9 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php wp_title('|', true, 'right'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> Feed" href="<?php echo esc_url(get_feed_link()); ?>"> <link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> Feed" href="<?php echo esc_url(get_feed_link()); ?>">
<?php wp_head(); ?>
</head> </head>

View File

@@ -13,7 +13,7 @@
<nav class="collapse navbar-collapse" role="navigation"> <nav class="collapse navbar-collapse" role="navigation">
<?php <?php
if (has_nav_menu('primary_navigation')) : if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav')); wp_nav_menu(array('theme_location' => 'primary_navigation', 'walker' => new Roots_Nav_Walker(), 'menu_class' => 'nav navbar-nav'));
endif; endif;
?> ?>
</nav> </nav>

View File

@@ -1,7 +1,7 @@
<form role="search" method="get" class="search-form form-inline" action="<?php echo esc_url(home_url('/')); ?>"> <form role="search" method="get" class="search-form form-inline" action="<?php echo esc_url(home_url('/')); ?>">
<label class="sr-only"><?php _e('Search for:', 'roots'); ?></label> <label class="sr-only"><?php _e('Search for:', 'roots'); ?></label>
<div class="input-group"> <div class="input-group">
<input type="search" value="<?php echo get_search_query(); ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>"> <input type="search" value="<?php echo get_search_query(); ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>" required>
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'roots'); ?></button> <button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'roots'); ?></button>
</span> </span>