Example #1
0
        if (sb_get_option('favicon')) {
            echo '<link rel="icon" type="image/png" href="' . sb_get_option('favicon') . '" />' . "\n";
        } else {
            echo '<link rel="icon" type="image/png" href="' . IMAGES_URL . '/favicon.png" />' . "\n";
        }
    }
    function tagline()
    {
        if (sb_get_option('tagline')) {
            $tag_container = apply_filters('sb_description_container', 'div');
            echo '<' . $tag_container . ' id="blog-description">' . get_bloginfo('description') . '</' . $tag_container . '>';
        }
    }
    // Deprecated Functions
    function nav_after()
    {
        _deprecated_function(__FUNCTION__, '2.4.9', 'primary_nav');
    }
    function nav_before()
    {
        _deprecated_function(__FUNCTION__, '2.4.9', 'secondary_nav');
    }
    function hooks()
    {
        add_action('sb_header', array($this, 'logo'));
        add_action('sb_header', array($this, 'tagline'));
        add_action('wp_head', array($this, 'favicon'));
    }
}
sb_register_settings('sb_header_settings');
Example #2
0
            if ($user_ID) {
                $links_array = $loggedin_links;
            } else {
                $links_array = $loggedout_links;
            }
            // Loop through all the links and store them in an array with proper HTML
            foreach ($links_array as $title => $url) {
                $links[] = '<li><a href="' . esc_url($url) . '">' . esc_html($title) . '</a></li>';
            }
            // Begin output
            $output .= '<div id="admin_links" class="fine">';
            if ($user_ID) {
                $output .= '<span id="login_identity">Logged in as <strong>' . $user_identity . '</strong>.</span>';
            }
            $output .= '<ul>';
            $output .= implode($separator, $links);
            $output .= '</ul>';
            $output .= '</div> <!-- #admin_links -->';
            // Filter the whole thing, incase someone wants to replace it entirely
            echo apply_filters('sb_footer_admin', $output);
        }
    }
    function hooks()
    {
        add_action('sb_footer', array($this, 'sb_rtt'), 5);
        add_action('sb_footer_left', array($this, 'copyright'), 12);
        add_action('sb_footer_right', array($this, 'admin'), 12);
    }
}
sb_register_settings('sb_footer_settings');
                    if (function_exists('status_header')) {
                        status_header(302);
                    }
                    header("Location:" . trim(sb_get_option('feedburner_feed_url')));
                    header("HTTP/1.1 302 Temporary Redirect");
                    exit;
                }
                break;
            case 'wp-commentsrss2.php':
                if (trim(sb_get_option('feedburner_comments_url')) != '') {
                    if (function_exists('status_header')) {
                        status_header(302);
                    }
                    header("Location:" . trim(sb_get_option('feedburner_comments_url')));
                    header("HTTP/1.1 302 Temporary Redirect");
                    exit;
                }
                break;
        }
    }
    function hooks()
    {
        if (!preg_match("/feedburner|feedvalidator/i", $_SERVER['HTTP_USER_AGENT'])) {
            add_action('template_redirect', array($this, 'sb_feed_redirect'));
            add_action('init', array($this, 'sb_check_url'));
        }
    }
}
if (!function_exists('ol_feed_redirect')) {
    sb_register_settings('sb_feedburner_settings');
}
<?php

class sb_upgrade_settings extends sb_settings
{
    function sb_upgrade_settings()
    {
        $this->name = __('Version Information', 'startbox');
        $this->slug = 'sb_upgrade_settings';
        $this->description = __('Enable automatic upgrades by checking one box and providing your StartBox license key.', 'startbox');
        $this->location = 'secondary';
        $this->priority = 'high';
        $this->options = array('sb_version_info' => array('type' => 'intro', 'desc' => sprintf(__('StartBox Version: %s', 'startbox'), get_option('startbox_version'))), 'enable_updates' => array('type' => 'checkbox', 'label' => __('Enable Automatic Updates', 'startbox'), 'default' => true), 'sb_license' => array('type' => 'text', 'label' => 'StartBox License', 'desc' => __('Enter your license to enable automatic updates.', 'startbox')));
        parent::__construct();
    }
}
if (current_theme_supports('sb-updates')) {
    sb_register_settings('sb_upgrade_settings');
}
    // Post Thumbnail in RSS feed
    function post_image_feeds($content)
    {
        global $post;
        $content = '<div><a href="' . the_permalink() . '" title="' . the_title() . '">' . sb_post_image() . '</a></div>' . $content;
        return $content;
    }
    function hooks()
    {
        add_filter('sb_get_post_layout_default', array($this, 'sb_layout'));
        add_filter('sb_read_more', array($this, 'more_text'));
        add_action('sb_post_header', array($this, 'sb_header_meta'));
        add_action('sb_post_footer', array($this, 'sb_footer_meta'));
        if (sb_get_option('author_bio') == 'before') {
            add_action('sb_before_post_content', array($this, 'sb_author_bio'));
        }
        if (sb_get_option('author_bio') == 'after') {
            add_action('sb_after_post_content', array($this, 'sb_author_bio'));
        }
        add_action('sb_before_content', array($this, 'sb_post_nav'));
        add_action('sb_after_content', array($this, 'sb_post_nav'));
        if (sb_get_option('post_thumbnail_rss')) {
            add_filter('the_excerpt_rss', array($this, 'post_image_feeds'));
            add_filter('the_content_feed', array($this, 'post_image_feeds'));
        }
        add_filter('sb_post_image_settings', array($this, 'image_settings'));
        add_filter('sb_post_image_none', array($this, 'image_default'));
    }
}
sb_register_settings('sb_content_settings');
Example #6
0
    function sb_seo_settings()
    {
        $this->name = __('Basic SEO Settings', 'startbox');
        $this->slug = 'sb_settings_seo';
        $this->location = 'secondary';
        $this->priority = 'core';
        $this->options = array('seo_intro' => array('type' => 'intro', 'label' => '', 'desc' => __('These are only rudimentary options that will disappear as soon as you activate an SEO plugin. I highly recommend you use the <a href="http://wordpress.org/extend/plugins/wordpress-seo/" target="_blank">WordPress SEO Plugin</a> instead of these.', 'startbox')), 'seo_description' => array('type' => 'textarea', 'label' => __('Site Description', 'startbox'), 'default' => get_bloginfo('description'), 'desc' => __('Try to keep this brief.', 'startbox')), 'seo_keywords' => array('type' => 'text', 'label' => __('Site-wide Keywords', 'startbox'), 'size' => 'medium', 'desc' => __('Comma separated (e.g. WordPress, themes, etc)', 'startbox')));
        parent::__construct();
    }
    function sb_seo_keywords()
    {
        if ($keywords = sb_get_option('seo_keywords')) {
            echo '<meta name="keywords" content="' . esc_attr($keywords) . '" />' . "\n";
        }
    }
    function sb_seo_description($content)
    {
        if ($description = sb_get_option('seo_description')) {
            echo '<meta name="description" content="' . apply_filters('sb_description', esc_attr($description)) . '" />';
        }
    }
    function hooks()
    {
        add_action('wp_head', array($this, 'sb_seo_description'));
        add_action('wp_head', array($this, 'sb_seo_keywords'));
    }
}
// Only include this metabox if no other popular SEO plugins are active
if (!defined('WPSEO_FRONT_URL') && !class_exists('All_in_One_SEO_Pack') && !class_exists('Platinum_SEO_Pack') && !class_exists('HeadSpace_Plugin')) {
    sb_register_settings('sb_seo_settings');
}
Example #7
0
<?php

class sb_settings_help extends sb_settings
{
    function sb_settings_help()
    {
        $this->name = __('Need Help?', 'startbox');
        $this->slug = 'sb_settings_help';
        $this->location = 'secondary';
        $this->priority = 'high';
        parent::__construct();
    }
    function form()
    {
        echo '<p>' . sprintf(__('Struggling with some of the theme options or settings? Have a look at the comprehensive %1$stheme documentation%2$s.', 'startbox'), '<a href="http://docs.wpstartbox.com" target="_blank">', '</a>') . '</p>';
    }
}
sb_register_settings('sb_settings_help');
<?php

class sb_analytics_settings extends sb_settings
{
    function sb_analytics_settings()
    {
        $this->name = __('Google Analytics', 'startbox');
        $this->slug = 'sb_analytics_settings';
        $this->description = __('Paste in your tracking codes for your preferred site statistics software (like Google Analytics).', 'startbox');
        $this->location = 'secondary';
        $this->priority = 'core';
        $this->options = array('analytics' => array('type' => 'textarea', 'label' => sprintf(__('Enter your %s code below:'), '<a href="http://google.com/analytics" target="_blank">analytics</a>'), 'sanitize' => false));
        parent::__construct();
    }
    function output()
    {
        if (sb_get_option('analytics')) {
            echo "\n\n" . '<!-- BEGIN Analytics-->' . "\n";
            echo sb_get_option('analytics') . "\n";
            echo '<!-- END Analytics-->' . "\n";
        }
    }
    function hooks()
    {
        add_action('wp_head', array($this, 'output'));
    }
}
sb_register_settings('sb_analytics_settings');
Example #9
0
<?php

class sb_pushup_settings extends sb_settings
{
    public function sb_pushup_settings()
    {
        $this->name = __('Save the Web', 'startbox');
        $this->slug = 'sb_pushup_settings';
        $this->location = 'secondary';
        $this->priority = 'low';
        $this->options = array('intro' => array('type' => 'intro', 'desc' => sprintf(__('Help save the internet by letting users of older browsers know that it\'s time for an upgrade. %sSee an example &raquo;%s', 'startbox'), '<a href="http://pushuptheweb.com/" title="Push Up The Web" target="_blank">', '</a>')), 'enable_pushup' => array('type' => 'checkbox', 'label' => __('Save the web!', 'startbox'), 'default' => 'true'));
        parent::__construct();
    }
    public function sb_pushup_output()
    {
        if (sb_get_option('enable_pushup')) {
            wp_enqueue_script('pushup');
            wp_enqueue_style('pushup');
        }
    }
    public function hooks()
    {
        add_action('template_redirect', array($this, 'sb_pushup_output'));
    }
}
sb_register_settings('sb_pushup_settings');
        $this->slug = 'sb_navigation_settings';
        $this->description = __('Take full control of your navigation. Select which menu to display, where to display it, and whether or not to include a "Home" link.', 'startbox');
        $this->location = 'primary';
        $this->priority = 'high';
        $this->options = array('primary_nav' => array('type' => 'navigation', 'label' => __('Primary Navigation', 'startbox'), 'default' => 'pages', 'align' => 'left', 'home_default' => true, 'position_default' => 'sb_after_header', 'extras' => true), 'div' => array('type' => 'divider'), 'secondary_nav' => array('type' => 'navigation', 'label' => __('Secondary Navigation', 'startbox'), 'default' => 'none', 'home_default' => false, 'position_default' => 'sb_before', 'extras' => true), 'div2' => array('type' => 'divider'), 'footer_nav' => array('type' => 'navigation', 'label' => __('Footer Navigation', 'startbox'), 'default' => 'disabled', 'home_default' => false, 'position' => apply_filters('sb_footer_nav_position', array('sb_between_content_and_footer' => __('Before Footer Wrap', 'startbox'), 'sb_before_footer' => __('Before Footer Widgets', 'startbox'), 'sb_footer' => __('After Footer Widgets', 'startbox'), 'sb_footer_left' => __('Footer Left (above copyright)', 'startbox'), 'sb_footer_right' => __('Footer Right (above admin links)', 'startbox'), 'sb_after_footer' => __('Bottom of Page', 'startbox')))));
        parent::__construct();
    }
    function primary_nav()
    {
        sb_nav_menu(array('menu_id' => 'primary_nav', 'type' => sb_get_option('primary_nav'), 'show_home' => sb_get_option('primary_nav-enable-home'), 'extras' => sb_get_option('primary_nav-extras'), 'class' => 'nav nav-primary nav-' . sb_get_option('primary_nav-position'), 'depth' => sb_get_option('primary_nav-depth'), 'echo' => true));
    }
    function secondary_nav()
    {
        sb_nav_menu(array('menu_id' => 'secondary_nav', 'type' => sb_get_option('secondary_nav'), 'show_home' => sb_get_option('secondary_nav-enable-home'), 'extras' => sb_get_option('secondary_nav-extras'), 'class' => 'nav nav-secondary nav-' . sb_get_option('secondary_nav-position'), 'depth' => sb_get_option('secondary_nav-depth'), 'echo' => true));
    }
    function footer_nav()
    {
        sb_nav_menu(array('type' => sb_get_option('footer_nav'), 'class' => 'nav nav-footer nav-' . sb_get_option('footer_nav-position'), 'show_home' => sb_get_option('footer_nav-enable-home'), 'depth' => sb_get_option('footer_nav-depth'), 'echo' => true));
    }
    function hooks()
    {
        $primary_nav = sb_get_option('primary_nav-position');
        $secondary_nav = sb_get_option('secondary_nav-position');
        $footer_nav = sb_get_option('footer_nav-position');
        add_action($primary_nav, array($this, 'primary_nav'));
        add_action($secondary_nav, array($this, 'secondary_nav'));
        add_action($footer_nav, array($this, 'footer_nav'), 11);
    }
}
sb_register_settings('sb_navigation_settings');