'navbar_site_name', 'value' => the_bootstrap_options()->navbar_site_name, 'description' => __( 'Add site name to navigation bar.', 'the-bootstrap' ) ), (object) array( 'name' => 'navbar_searchform', 'value' => the_bootstrap_options()->navbar_searchform, 'description' => __( 'Add searchform to navigation bar.', 'the-bootstrap' ) ) ) ); add_settings_field( 'navbar-position', __( 'Navigation Bar Position', 'the-bootstrap' ), 'the_bootstrap_settings_field_radio', 'theme_options', 'general', array( 'name' => 'navbar_position', 'options' => array( (object) array( 'value' => 'static', 'description' => __( 'Static.', 'the-bootstrap' ) ), (object) array( 'value' => 'navbar-fixed-top', 'description' => __( 'Fixed on top.', 'the-bootstrap' ) ), (object) array( 'value' => 'navbar-fixed-bottom', 'description' => __( 'Fixed at bottom.', 'the-bootstrap' ) ), ) ) ); } add_action( 'admin_init', 'the_bootstrap_theme_options_init' ); /** * Change the capability required to save the 'the_bootstrap_options' options group. * * @see the_bootstrap_theme_options_init() First parameter to register_setting() is the name of the options group. * @see the_bootstrap_theme_options_add_page() The edit_theme_options capability is used for viewing the page. * * @author Automattic * @since 1.3.0 - 06.04.2012 * * @param string $capability The capability used for the page, which is manage_options by default. * * @return string The capability to actually use. */ function the_bootstrap_option_page_capability( $capability ) { return 'edit_theme_options'; } add_filter( 'option_page_capability_the_bootstrap_options', 'the_bootstrap_option_page_capability' ); /** * Add theme options page to the admin bar. * * @author Konstantin Obenland * @since 1.3.0 - 06.04.2012 * * @param WP_Admin_Bar $wp_admin_bar * * @return void */ function the_bootstrap_admin_bar_menu( $wp_admin_bar ) { if ( current_user_can( 'edit_theme_options' ) AND is_admin_bar_showing() ) { $wp_admin_bar->add_menu( array( 'title' => __( 'Theme Options', 'the-bootstrap' ), 'href' => add_query_arg( array( 'page' => 'theme_options' ), admin_url( 'themes.php' ) ), 'parent' => 'appearance', 'id' => 'the-bootstrap-theme-options', ) ); } } add_action( 'admin_bar_menu', 'the_bootstrap_admin_bar_menu', 61 ); //Appearance Menu used to be added at 60 /** * Returns the options object for The Bootstrap. * * @author Automattic * @since 1.3.0 - 06.04.2012 * * @return stdClass Theme Options */ function the_bootstrap_options() { return (object) wp_parse_args( get_option( 'the_bootstrap_theme_options', array() ), the_bootstrap_get_default_theme_options() ); } /** * Returns the default options for The Bootstrap. * * @author Automattic * @since 1.3.0 - 06.04.2012 * * @return void */ function the_bootstrap_get_default_theme_options() { $default_theme_options = array( 'theme_layout' => 'content-sidebar', 'navbar_site_name' => false, 'navbar_searchform' => true, 'navbar_position' => 'static', ); return apply_filters( 'the_bootstrap_default_theme_options', $default_theme_options ); } /** * Returns an array of layout options registered for Twenty Eleven. * * @author WordPress.org * @since 1.3.0 - 06.04.2012 * * @return void */ function the_bootstrap_layouts() { $layout_options = array( 'content-sidebar' => array( 'label' => __( 'Content on left', 'the-bootstrap' ), 'thumbnail' => get_template_directory_uri() . '/images/content-sidebar.png', ), 'sidebar-content' => array( 'label' => __( 'Content on right', 'the-bootstrap' ), 'thumbnail' => get_template_directory_uri() . '/images/sidebar-content.png', ), ); return apply_filters( 'the_bootstrap_layouts', $layout_options ); } /** * Renders the Layout setting field. * * @author WordPress.org * @since 1.3.0 - 06.04.2012 * * @return void */ function the_bootstrap_settings_field_layout() { foreach ( the_bootstrap_layouts() as $value => $layout ) : ?>
null, 'options' => array(), ) ) ); foreach ( (array) $options as $o ) : ?>

Visit your site to see how it looks.', 'the-bootstrap' ), home_url( '/' ) ), 'updated' ); } return apply_filters( 'the_bootstrap_theme_options_validate', $output, $input, $defaults ); } /////////////////////////////////////////////////////////////////////////////// // META BOXES /////////////////////////////////////////////////////////////////////////////// /** * Displays a box with a donate button and call to action links * * Props Joost de Valk, as this is almost entirely from his awesome WordPress * SEO Plugin * * @link http://plugins.trac.wordpress.org/browser/wordpress-seo/trunk/admin/class-config.php#L82 * @copyright Joost de Valk * @license GPLv2 or later * * @author Joost de Valk, Konstantin Obenland * @since 1.3.0 - 06.04.2012 * * @return void */ function the_bootstrap_donate_box() { ?>

get_items( 0, $rss->get_item_quantity( 5 ) ); // If the feed was erroneously if ( ! $rss_items ) { $md5 = md5( $feed_url ); delete_transient( 'feed_' . $md5 ); delete_transient( 'feed_mod_' . $md5 ); $rss = fetch_feed( $feed_url ); $rss_items = $rss->get_items( 0, $rss->get_item_quantity( 5 ) ); } return $rss_items; } /////////////////////////////////////////////////////////////////////////////// // FRONT END /////////////////////////////////////////////////////////////////////////////// /** * Adds The Bootstrap layout classes to the array of body classes. * * @author WordPress.org * @since 1.3.0 - 06.04.2012 * * @return void */ function the_bootstrap_layout_classes( $existing_classes ) { $classes = array( the_bootstrap_options()->theme_layout ); $classes = apply_filters( 'the_bootstrap_layout_classes', $classes ); return array_merge( $existing_classes, $classes ); } add_filter( 'body_class', 'the_bootstrap_layout_classes' ); /* End of file theme-options.php */ /* Location: ./wp-content/themes/the-bootstrap/inc/theme-options.php */