Skip to content

Commit

Permalink
Dusting off the 2.6 branch
Browse files Browse the repository at this point in the history
Lots of changes, haven't checked in for quite awhile. Dusting off this
2.6 branch and redoubling my efforts :)
  • Loading branch information
brichards committed Sep 3, 2012
1 parent 54d5c67 commit bdcc7b6
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 21 deletions.
8 changes: 7 additions & 1 deletion author.php
Expand Up @@ -19,12 +19,18 @@
<?php endif; ?>
</div><!-- #entry-author-info -->

<?php
<?php
// Provide a hook for placing content before author posts
do_action( 'sb_author_before_posts' );

// Grab the author's posts
rewind_posts();
if ( 'post' != get_post_type() )
get_template_part( 'loop', get_post_type() );
else
get_template_part( 'loop', get_post_format() );

// Standard "after content" hook
do_action( 'sb_after_content' );
?>

Expand Down
6 changes: 5 additions & 1 deletion changelog.txt
@@ -1,5 +1,7 @@
2012.02.05 - version 2.6
* added: shortcode [sitemap] to leverage the sitemap/archive functionality anywhere
* added: hook "sb_author_before_posts" on author.php after the author's meta information, before their posts are inserted
* added: theme option to use beta updates when available
* changed: the Sitemap Page Template now accepts parameters passed through the Custom Field "sitemap_settings"
* changed: updated all post image functions to run off a single array or argument string, instead of multiple arguments
* changed: updated all templates to use get_post_format() and get_post_type() in get_template_part() for post loops.
Expand All @@ -8,7 +10,9 @@
* changed: [date] shortcode now accepts "relative=true" parameter to return a relative date (e.g. 5 hours ago)
* changed: updated SB Social widget to include Google+ and more gracefully handle output of each network's name
* changed: passed SB and Theme versions through wp_enqueue_style calls
* fixed: minor (but annoying) bug introduced in 2.5.4 that prevented sidebar settings from being stored on first save.
* changed: footer widgets now hook into sb_footer_widgets via hooks.php (they were previously hard-coded)
* fixed: annoying bug introduced in 2.5.4 that prevented sidebar settings from being stored on first save.
* fixed: bug that prevented WordPress SEO (by Yoast) from overwriting page titles
* fixed: bug that would cause the RSS nav menu extra link to use href="true" instead of href="/your/feed/url/"
* added: /includes/functions/conditionals.php
* added: /includes/functions/images.php
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Expand Up @@ -9,7 +9,7 @@
<div id="footer">

<?php
get_sidebar('footer');
do_action( 'sb_footer_widgets' );
do_action( 'sb_footer' );
if ( has_action( 'wp_footer' ) ) {
echo '<div id="wp_footer">';
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Expand Up @@ -15,7 +15,7 @@

// Initialize StartBox, but only if a child theme hasn't already
if( !did_action( 'sb_init' ) ) {
require_once( TEMPLATEPATH . '/includes/functions/startbox.php' );
require_once( get_template_directory() . '/includes/functions/startbox.php' );
StartBox::init();
}

Expand Down
6 changes: 6 additions & 0 deletions includes/admin/upgrade.php
Expand Up @@ -15,6 +15,12 @@ function sb_upgrade_settings() {
'type' => 'checkbox',
'label' => __('Enable Automatic Updates', 'startbox'),
'default' => true
),
'use_beta' => array(
'type' => 'checkbox',
'label' => __('Use Beta Updates', 'startbox'),
'desc' => __('Note: Do NOT run beta updates in a production environment', 'startbox'),
'default' => false
)
);
parent::__construct();
Expand Down
Empty file modified includes/extensions/startbox-slideshows.zip 100644 → 100755
Empty file.
Empty file modified includes/functions/conditionals.php 100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions includes/functions/depricated.php
Expand Up @@ -31,10 +31,12 @@ function sb_after_content() { _deprecated_function( __FUNCTION__, '2.6', 'do_act
function sb_404() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_404\' )' ); do_action('sb_404'); } // Inside div.post, only on 404 page

// Located in loop.php and single.php
function sb_before_post() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_before_post\' )' ); do_action('sb_before_post'); } // Before div.post
function sb_before_post_content() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_before_post_content\' )' ); do_action('sb_before_post_content'); } // Inside div.post, after .entry-header, before .entry-content
function sb_post_header() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_post_header\' )' ); do_action('sb_post_header' ); } // Inside div.entry-meta
function sb_post_footer() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_post_footer\' )' ); do_action('sb_post_footer' ); } // Inside div.entry-footer
function sb_after_post_content() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_after_post_content\' )' ); do_action('sb_after_post_content'); } // Inside div.post, after .entry-content, before .entry-footer
function sb_after_post() { _deprecated_function( __FUNCTION__, '2.6', 'do_action( \'sb_after_post\' )' ); do_action('sb_after_post'); } // Inside div.post, after .entry-content, before .entry-footer

// Located in sidebar.php
function sb_between_primary_and_secondary_widgets() { _deprecated_function( __FUNCTION__, '2.5', 'do_action( \'sb_after_primary_aside_widgets\' )' ); do_action('sb_between_primary_and_secondary_widgets');}
Expand Down
10 changes: 8 additions & 2 deletions includes/functions/hooks.php
Expand Up @@ -195,9 +195,9 @@ function sb_home_content() {
<?php }
else {
if ( 'post' != get_post_type() )
get_template_part( 'loop', get_post_type() );
get_template_part( 'loop-home', get_post_type() );
else
get_template_part( 'loop', get_post_format() );
get_template_part( 'loop-home', get_post_format() );
}
endwhile;
}
Expand Down Expand Up @@ -295,6 +295,12 @@ function sb_after_first_post() { global $firstpost; if ( !isset( $firstpost ) )

////////////////////////////////////////////////// Items To Hook into Footer //////////////////////////////////////////////////

// Include our footer widgets
function sb_footer_widgets() {
get_sidebar('footer');
}
add_action( 'sb_footer_widgets', 'sb_footer_widgets' );

// Auto-hide the address bar in mobile Safari (iPhone)
function sb_iphone() { echo '<script type="text/javascript">window.scrollTo(0, 1);</script>'; }
add_action('sb_after','sb_iphone');
Expand Down
Empty file modified includes/functions/images.php 100644 → 100755
Empty file.
Empty file modified includes/functions/menus.php 100644 → 100755
Empty file.
35 changes: 25 additions & 10 deletions includes/functions/startbox.php
Expand Up @@ -17,18 +17,31 @@ public function init() {

// Grab and define our variables and constants
global $blog_id;
$sb_data = get_theme_data( get_template_directory() . '/style.css' );
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
define( 'THEME_NAME', $theme_data['Name'] );
define( 'THEME_VERSION', $theme_data['Version'] );

if ( function_exists('wp_get_theme') ) {
// wp_get_theme was introduced in WP3.4
$startbox = wp_get_theme( 'startbox' );
$current_theme = wp_get_theme();
$sb_version = $startbox->version;
$theme_version = $current_theme->version;
} else {
$startbox = get_theme_data( get_template_directory() . '/style.css' );
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
$sb_version = $sb_data['version'];
$theme_version = $theme_data['version'];
$current_theme = $theme_data['Name'];
}

define( 'THEME_NAME', $current_theme );
define( 'THEME_VERSION', $theme_version );
define( 'THEME_OPTIONS', 'startbox' );
define( 'THEME_PREFIX', 'sb_' );
define( 'SB_VERSION', $sb_data['Version'] );
define( 'SB_VERSION', $sb_version );
define( 'IS_MU', (isset($blog_id) && $blog_id > 0) ? true : false );
define( 'THEME_PATH', get_stylesheet_directory() );
define( 'THEME_URI', get_stylesheet_directory_uri() );
define( 'SB_PATH', get_template_directory() );
define( 'INCLUDES_PATH', TEMPLATEPATH . '/includes' );
define( 'INCLUDES_PATH', get_template_directory() . '/includes' );
define( 'INCLUDES_URL', get_template_directory_uri() . '/includes' );
define( 'ADMIN_PATH', INCLUDES_PATH . '/admin' );
define( 'FUNCTIONS_PATH', INCLUDES_PATH . '/functions' );
Expand Down Expand Up @@ -114,6 +127,7 @@ public function environment() {
add_theme_support( 'sb-updates' ); // StartBox Updates Manager
add_theme_support( 'sb-options' ); // StartBox Options API
add_theme_support( 'sb-sidebars' ); // StartBox Easy Sidebars
add_theme_support( 'sb-theme-customizer' ); // StartBox Theme Customizer Settings

// Add theme support for StartBox Layouts, redefine this list of available layouts using the filter 'sb_layouts_defaults'
$sb_default_layouts = array(
Expand Down Expand Up @@ -146,11 +160,12 @@ public function environment() {
// Include all Widgets, Plugins and Theme Options
public function sb_includes() {

require_if_theme_supports( 'sb-sidebars', EXTENSIONS_PATH . '/sidebars.php' ); // Sidebar manager
require_if_theme_supports( 'sb-layouts', FUNCTIONS_PATH . '/layouts.php' ); // Theme Layouts
foreach ( glob( WIDGETS_PATH . '/*.php') as $sb_widget ) { require_once( $sb_widget ); } // Widgets
foreach ( glob( ADMIN_PATH . '/*.php') as $sb_admin ) { require_if_theme_supports( 'sb-options', $sb_admin ); } // Theme Options
require_if_theme_supports( 'sb-updates', FUNCTIONS_PATH . '/upgrade.php' ); // Update Manager
require_if_theme_supports( 'sb-sidebars', EXTENSIONS_PATH . '/sidebars.php' ); // Sidebar manager
require_if_theme_supports( 'sb-layouts', FUNCTIONS_PATH . '/layouts.php' ); // Theme Layouts
require_if_theme_supports( 'sb-theme-customizer', EXTENSIONS_PATH . '/theme-customizer.php' ); // Theme Customizer settings
foreach ( glob( ADMIN_PATH . '/*.php') as $sb_admin ) { require_if_theme_supports( 'sb-options', $sb_admin ); } // Theme Options
foreach ( glob( WIDGETS_PATH . '/*.php') as $sb_widget ) { require_once( $sb_widget ); } // Widgets

// Check installed version, upgrade if needed (Credit: K2, http://getk2.com)
$sb_version = get_option( 'startbox_version' );
Expand Down
11 changes: 6 additions & 5 deletions includes/functions/upgrade.php
Expand Up @@ -17,7 +17,7 @@ function update_check() {
// Don't bother checking if updates are disabled
if (!sb_get_option('enable_updates'))
return;

$sb_update = get_transient('sb_update');

if ( !$sb_update ) {
Expand All @@ -35,7 +35,8 @@ function update_check() {
$wp = get_bloginfo("version") ;
$php = phpversion();
$mysql = $wpdb->db_version();
$url = 'http://wpstartbox.com/updates/index.php?product=StartBox&sb_version=' . urlencode($sb) . '&wp_version=' . urlencode($wp) . '&php_version=' . urlencode($php) . '&mysql_version=' . urlencode($mysql);
$use_beta = ( sb_get_option( 'use_beta' ) ) ? "true" : "false";
$url = 'http://wpstartbox.com/updates/index.php?product=StartBox&sb_version=' . urlencode($sb) . '&wp_version=' . urlencode($wp) . '&php_version=' . urlencode($php) . '&mysql_version=' . urlencode($mysql) . '&use_beta=' . $use_beta;
$raw_response = wp_remote_request($url, $options);
$sb_update = wp_remote_retrieve_body($raw_response);

Expand Down Expand Up @@ -67,7 +68,7 @@ function update_include($value) {

// Add an update alert to the dashboard when upgrade is available
function update_notification() {

// Don't bother checking if updates are disabled
if (!sb_get_option('enable_updates') || sb_get_option('disable_update_notifications') )
return;
Expand All @@ -92,7 +93,7 @@ function clear_update_transient() {
delete_transient('sb_update');
remove_action('admin_notices', 'sb_update_notification');
}

// This makes everything work and hooks it where it belongs.
public function __construct() {
add_filter('site_transient_update_themes', array( $this, 'update_include') );
Expand All @@ -101,7 +102,7 @@ public function __construct() {
add_action('load-update.php', array( $this, 'clear_update_transient') );
add_action('load-themes.php', array( $this, 'clear_update_transient') );
}

}
$sb_upgrade = new sb_upgrade;

Expand Down
2 changes: 2 additions & 0 deletions notes.txt
Expand Up @@ -10,6 +10,8 @@ Contents

##### 2.6
review Options API
change menu options to include searchform.php instead of custom search html
CSS integration for theme customization? http://wordpress.org/extend/plugins/css/

##### 2.7
add import/export for theme settings
Expand Down

0 comments on commit bdcc7b6

Please sign in to comment.