'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 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() . '/img/content-sidebar.png',
),
'sidebar-content' => array(
'label' => __( 'Content on right', 'the-bootstrap' ),
'thumbnail' => get_template_directory_uri() . '/img/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 ) : ?>