Merge branch 'master' into grunt

This commit is contained in:
Ben Word
2012-11-02 01:13:16 -05:00
7 changed files with 23 additions and 40 deletions

View File

@@ -1,4 +1,6 @@
### HEAD ### HEAD
* Remove `lib/post-types.php` and `lib/metaboxes.php`
* Make sure Primary Navigation menu always gets created and has the location set upon activation, update activation permalink method
* Update to Bootstrap 2.2.1 * Update to Bootstrap 2.2.1
* Update conditional feed method * Update conditional feed method
* Update to Bootstrap 2.2.0 * Update to Bootstrap 2.2.0

View File

@@ -50,18 +50,10 @@ This file handles the clean URL rewrites and HTML5 Boilerplate `.htaccess`. [Abo
This file runs the initial theme setup and defines helper constants for later use This file runs the initial theme setup and defines helper constants for later use
### metaboxes.php
This file is a placeholder for you to put in custom metaboxes. We recommend the use of [Custom Metaboxes and Fields for WordPress](https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress).
### nav.php ### nav.php
This file contains all the custom nav modifications (for Bootstrap) and clean up. This file contains all the custom nav modifications (for Bootstrap) and clean up.
### post-types.php
This file is a placeholder for you to put in [custom post types](http://codex.wordpress.org/Function_Reference/register_post_type) and [taxonomies](http://codex.wordpress.org/Function_Reference/register_taxonomy).
### scripts.php ### scripts.php
This file handles all of the CSS and JavaScript. This file handles all of the CSS and JavaScript.

View File

@@ -34,17 +34,16 @@ A basic Roots theme initially looks like this:
├── lang ├── lang
│ └── roots.pot │ └── roots.pot
├── lib ├── lib
│ ├── actions.php
│ ├── activation.php │ ├── activation.php
│ ├── cleanup.php │ ├── cleanup.php
│ ├── config.php │ ├── config.php
│ ├── custom.php │ ├── custom.php
│ ├── h5bp-htaccess │ ├── h5bp-htaccess
│ ├── htaccess.php │ ├── htaccess.php
│ ├── metaboxes.php │ ├── init.php
│ ├── post-types.php │ ├── nav.php
│ ├── scripts.php │ ├── scripts.php
│ ├── template-tags.php │ ├── sidebar.php
│ ├── utils.php │ ├── utils.php
│ └── widgets.php │ └── widgets.php
├── templates ├── templates
@@ -52,6 +51,7 @@ A basic Roots theme initially looks like this:
│ ├── content.php │ ├── content.php
│ ├── content-page.php │ ├── content-page.php
│ ├── content-single.php │ ├── content-single.php
│ ├── entry-meta.php
│ ├── footer.php │ ├── footer.php
│ ├── head.php │ ├── head.php
│ ├── header.php │ ├── header.php

View File

@@ -15,6 +15,4 @@ require_once locate_template('/lib/nav.php'); // Custom nav modifica
require_once locate_template('/lib/htaccess.php'); // Rewrites for assets, H5BP .htaccess require_once locate_template('/lib/htaccess.php'); // Rewrites for assets, H5BP .htaccess
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/post-types.php'); // Custom post types
require_once locate_template('/lib/metaboxes.php'); // Custom metaboxes
require_once locate_template('/lib/custom.php'); // Custom functions require_once locate_template('/lib/custom.php'); // Custom functions

View File

@@ -16,13 +16,11 @@ function roots_theme_activation_options_init() {
'roots_theme_activation_options_validate' 'roots_theme_activation_options_validate'
); );
} }
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($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');
function roots_theme_activation_options_add_page() { function roots_theme_activation_options_add_page() {
@@ -43,9 +41,7 @@ function roots_theme_activation_options_add_page() {
exit; exit;
} }
} }
} }
add_action('admin_menu', 'roots_theme_activation_options_add_page', 50); add_action('admin_menu', 'roots_theme_activation_options_add_page', 50);
function roots_get_default_theme_activation_options() { function roots_get_default_theme_activation_options() {
@@ -66,10 +62,9 @@ function roots_get_theme_activation_options() {
} }
function roots_theme_activation_options_render_page() { ?> function roots_theme_activation_options_render_page() { ?>
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php printf(__('%s Theme Activation', 'roots'), wp_get_theme() ); ?></h2> <h2><?php printf(__('%s Theme Activation', 'roots'), wp_get_theme()); ?></h2>
<?php settings_errors(); ?> <?php settings_errors(); ?>
<form method="post" action="options.php"> <form method="post" action="options.php">
@@ -80,7 +75,7 @@ function roots_theme_activation_options_render_page() { ?>
$roots_default_activation_options = roots_get_default_theme_activation_options(); $roots_default_activation_options = roots_get_default_theme_activation_options();
?> ?>
<input type="hidden" value="1" name="roots_theme_activation_options[first_run]" /> <input type="hidden" value="1" name="roots_theme_activation_options[first_run]">
<table class="form-table"> <table class="form-table">
@@ -91,7 +86,7 @@ function roots_theme_activation_options_render_page() { ?>
<option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option> <option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option>
<option value="no"><?php echo _e('No', 'roots'); ?></option> <option value="no"><?php echo _e('No', 'roots'); ?></option>
</select> </select>
<br /> <br>
<small class="description"><?php printf(__('Create a page called Home and set it to be the static front page', 'roots')); ?></small> <small class="description"><?php printf(__('Create a page called Home and set it to be the static front page', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
@@ -104,7 +99,7 @@ function roots_theme_activation_options_render_page() { ?>
<option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option> <option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option>
<option value="no"><?php echo _e('No', 'roots'); ?></option> <option value="no"><?php echo _e('No', 'roots'); ?></option>
</select> </select>
<br /> <br>
<small class="description"><?php printf(__('Change permalink structure to /&#37;postname&#37;/', 'roots')); ?></small> <small class="description"><?php printf(__('Change permalink structure to /&#37;postname&#37;/', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
@@ -117,7 +112,7 @@ function roots_theme_activation_options_render_page() { ?>
<option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option> <option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option>
<option value="no"><?php echo _e('No', 'roots'); ?></option> <option value="no"><?php echo _e('No', 'roots'); ?></option>
</select> </select>
<br /> <br>
<small class="description"><?php printf(__('Change uploads folder to /assets/ instead of /wp-content/uploads/', 'roots')); ?></small> <small class="description"><?php printf(__('Change uploads folder to /assets/ instead of /wp-content/uploads/', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
@@ -130,7 +125,7 @@ function roots_theme_activation_options_render_page() { ?>
<option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option> <option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option>
<option value="no"><?php echo _e('No', 'roots'); ?></option> <option value="no"><?php echo _e('No', 'roots'); ?></option>
</select> </select>
<br /> <br>
<small class="description"><?php printf(__('Create the Primary Navigation menu and set the location', 'roots')); ?></small> <small class="description"><?php printf(__('Create the Primary Navigation menu and set the location', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
@@ -143,7 +138,7 @@ function roots_theme_activation_options_render_page() { ?>
<option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option> <option selected="selected" value="yes"><?php echo _e('Yes', 'roots'); ?></option>
<option value="no"><?php echo _e('No', 'roots'); ?></option> <option value="no"><?php echo _e('No', 'roots'); ?></option>
</select> </select>
<br /> <br>
<small class="description"><?php printf(__('Add all current published pages to the Primary Navigation', 'roots')); ?></small> <small class="description"><?php printf(__('Add all current published pages to the Primary Navigation', 'roots')); ?></small>
</fieldset> </fieldset>
</td> </td>
@@ -260,12 +255,12 @@ function roots_theme_activation_action() {
if ($roots_theme_activation_options['change_permalink_structure']) { if ($roots_theme_activation_options['change_permalink_structure']) {
$roots_theme_activation_options['change_permalink_structure'] = false; $roots_theme_activation_options['change_permalink_structure'] = false;
global $wp_rewrite;
if (get_option('permalink_structure') !== '/%postname%/') { if (get_option('permalink_structure') !== '/%postname%/') {
update_option('permalink_structure', '/%postname%/'); $wp_rewrite->set_permalink_structure('/%postname%/');
} }
global $wp_rewrite;
$wp_rewrite->init(); $wp_rewrite->init();
$wp_rewrite->flush_rules(); $wp_rewrite->flush_rules();
} }
@@ -282,9 +277,13 @@ function roots_theme_activation_action() {
$roots_nav_theme_mod = false; $roots_nav_theme_mod = false;
if (!has_nav_menu('primary_navigation')) { $existing_nav = wp_get_nav_menu_object('Primary Navigation');
if (!$existing_nav) {
$primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation')); $primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation'));
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id; $roots_nav_theme_mod['primary_navigation'] = $primary_nav_id;
} else {
$primary_nav = wp_get_nav_menu_object('Primary Navigation');
$roots_nav_theme_mod['primary_navigation'] = $primary_nav->term_id;
} }
if ($roots_nav_theme_mod) { if ($roots_nav_theme_mod) {
@@ -314,11 +313,9 @@ function roots_theme_activation_action() {
update_option('roots_theme_activation_options', $roots_theme_activation_options); update_option('roots_theme_activation_options', $roots_theme_activation_options);
} }
add_action('admin_init','roots_theme_activation_action'); add_action('admin_init','roots_theme_activation_action');
function roots_deactivation_action() { function roots_deactivation() {
update_option('roots_theme_activation_options', roots_get_default_theme_activation_options()); delete_option('roots_theme_activation_options');
} }
add_action('switch_theme', 'roots_deactivation');
add_action('switch_theme', 'roots_deactivation_action');

View File

@@ -1,3 +0,0 @@
<?php
// Custom metaboxes

View File

@@ -1,3 +0,0 @@
<?php
// Custom post types