本文整理汇总了PHP中unregister_sidebar函数的典型用法代码示例。如果您正苦于以下问题:PHP unregister_sidebar函数的具体用法?PHP unregister_sidebar怎么用?PHP unregister_sidebar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unregister_sidebar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mb_remove_widgets
function mb_remove_widgets()
{
unregister_sidebar('sidebar-5');
unregister_sidebar('sidebar-6');
unregister_sidebar('sidebar-7');
unregister_sidebar('sidebar-2');
}
示例2: __construct
public function __construct($config = array())
{
if (is_admin()) {
return;
}
$this->config = array_replace_recursive($this->config, $config);
remove_action('genesis_doctype', 'genesis_do_doctype');
add_action('genesis_doctype', array($this, 'html5_doctype'));
add_action('wp_footer', array($this, 'output_js_components'));
remove_action('genesis_after_endwhile', 'genesis_posts_nav');
add_action('genesis_after_endwhile', array($this, 'posts_nav'));
add_action('genesis_before', array($this, 'open_container_class'));
add_action('genesis_after', array($this, 'close_container_class'));
remove_action('genesis_header', 'genesis_do_header');
if (true == $this->config['remove_header']) {
unregister_sidebar('header-right');
} else {
add_action('genesis_header', array($this, 'genesis_do_header'));
}
remove_action('genesis_header', 'genesis_header_markup_open', 5);
add_action('genesis_header', array($this, 'header_markup_open'), 5);
if (true == $this->config['main_nav']['filter']) {
add_filter('genesis_do_nav', array($this, 'bootstrap_do_nav'), 10, 3);
}
if (true == $this->config['load_assets']) {
wp_enqueue_script('gtb-bootstrap', $this->url() . '/assets/js/bootstrap.min.js', array('jquery'));
wp_enqueue_style('gtb-bootstrap', $this->url() . '/assets/css/bootstrap.min.css');
wp_enqueue_style('gtb-bootstrap-respsonive', $this->url() . '/assets/css/bootstrap-responsive.min.css');
}
}
开发者ID:Wordpress-Development,项目名称:genesis-twitter-bootstrap,代码行数:30,代码来源:Genesis_Twitter_Bootstrap.php
示例3: register_sidebars
/**
* Register sidebars
*/
public function register_sidebars()
{
unregister_sidebar('sidebar-event');
foreach ($this->sidebars as $id => $name) {
foreach ($this->places as $place) {
register_sidebar(array('id' => $id . '-' . $place, 'name' => $name . " ( {$place} )", 'description' => $name . " ( {$place} )", 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => apply_filters('wpv_before_widget_title', '<h4 class="widget-title">', 'body'), 'after_title' => apply_filters('wpv_after_widget_title', '</h4>', 'body')));
}
}
for ($i = 1; $i <= (int) wpv_get_option('footer-sidebars'); $i++) {
register_sidebar(array('id' => "footer-sidebars-{$i}", 'name' => "Footer widget area {$i}", 'description' => "Footer widget area {$i}", 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => apply_filters('wpv_before_widget_title', '<h4 class="widget-title">', 'footer'), 'after_title' => apply_filters('wpv_after_widget_title', '</h4>', 'footer')));
}
for ($i = 1; $i <= (int) wpv_get_option('header-sidebars'); $i++) {
register_sidebar(array('id' => "header-sidebars-{$i}", 'name' => "Body Top Widget Area {$i}", 'description' => "Body top widget area {$i}", 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => apply_filters('wpv_before_widget_title', '<h4 class="widget-title">', 'header'), 'after_title' => apply_filters('wpv_after_widget_title', '</h4>', 'header')));
}
if (wpv_get_option('feedback-type') == 'sidebar') {
register_sidebar(array('id' => 'feedback-sidebar', 'name' => 'Feedback Widget Area', 'description' => 'Slides out when the feedback button is clicked', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => apply_filters('wpv_before_widget_title', '<h4 class="widget-title">', 'feedback'), 'after_title' => apply_filters('wpv_after_widget_title', '</h4>', 'feedback')));
}
$custom_sidebars = wpv_get_option('custom-sidebars');
$custom_sidebars = explode(',', $custom_sidebars);
foreach ($custom_sidebars as $sidebar) {
$name = str_replace('wpv_sidebar-', '', $sidebar);
$sidebar = sanitize_title($sidebar);
if (!empty($sidebar)) {
foreach ($this->places as $place) {
register_sidebar(array('id' => $sidebar . '-' . $place, 'name' => "{$name} ( {$place} )", 'description' => "{$name} ( {$place} )", 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => apply_filters('wpv_before_widget_title', '<h4 class="widget-title">', 'body'), 'after_title' => apply_filters('wpv_after_widget_title', '</h4>', 'body'), 'class' => 'vamtam-custom'));
}
}
}
}
示例4: scratch_postsetup
function scratch_postsetup()
{
// Add theme widget areas
include_once get_stylesheet_directory() . '/includes/widget-areas.php';
// Unregister secondary sidebar
unregister_sidebar('sidebar-alt');
}
示例5: __construct
function __construct($dir_path)
{
// path & url class properties
$this->dir_path = trailingslashit($dir_path);
$this->url = trailingslashit(dirname(get_stylesheet_uri()));
$this->css_url = $this->url . 'asset/css/';
$this->js_url = $this->url . 'asset/js/';
$this->img_url = $this->url . 'asset/img/';
$this->slug = basename($this->dir_path);
$this->css_js_suffix = defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG ? '' : '.min';
// child theme version
$this->version = '1.0.1';
// actions
add_action('wp_enqueue_scripts', array($this, 'enqueue_assets'));
// enqueue our child theme assets
add_action('pre_get_posts', array($this, 'exclude_podcasts_on_blog_archive'));
// exclude podcast posts on the blog archive
// filters
add_filter('body_class', array($this, 'page_specific_body_class'));
// makes it easier to style specific pages
// custom podcast archive thumbnail image size
add_image_size('apply-filters-podcast-front-page-hard', 1040, 520, true);
/*
* we probably only need 1 site-wide sidebar
* remove all sidebars and instead hardcode the sidebar content into the sidebar.php template
*/
unregister_sidebar('sidebar_blog');
unregister_sidebar('sidebar_single');
unregister_sidebar('sidebar_page');
}
示例6: remove_some_widgets
function remove_some_widgets()
{
// Unregister some of the TwentyTen sidebars
unregister_sidebar('sidebar-1');
unregister_sidebar('sidebar-2');
unregister_sidebar('sidebar-3');
}
示例7: calibrefx_do_footer_widgets
/**
* Display the footer widget if the footer widget are active.
*/
function calibrefx_do_footer_widgets()
{
global $wp_registered_sidebars;
$footer_widgets = get_theme_support('calibrefx-footer-widgets');
$all_widgets = wp_get_sidebars_widgets();
//Check if footer widget theme support is activated or is there any widget inside
if (!$footer_widgets or !isset($all_widgets['footer-widget'])) {
return;
}
$count_footer_widgets = count($all_widgets['footer-widget']);
if (0 == $count_footer_widgets) {
return;
}
if (current_theme_supports('calibrefx-responsive-style')) {
$span = 'col-lg-' . strval(floor(12 / $count_footer_widgets)) . ' col-md-' . strval(floor(12 / $count_footer_widgets)) . ' col-sm-12 col-xs-12';
} else {
$span = 'col-xs-' . strval(floor(12 / $count_footer_widgets));
}
$sidebar = $wp_registered_sidebars['footer-widget'];
$footer_widget_column = apply_filters('calibrefx_footer_widget_column_span', $span);
$sidebar['before_widget'] = '<div id="%1$s" class="widget ' . $footer_widget_column . ' %2$s">';
$sidebar['after_widget'] = '</div>';
unregister_sidebar('footer-widget');
register_sidebar($sidebar);
if (is_active_sidebar('footer-widget')) {
echo '<div id="footer-widget">';
calibrefx_put_wrapper('footer-widget', 'open');
$footer_widget_wrapper_class = apply_filters('footer_widget_wrapper_class', calibrefx_row_class());
echo '<div class="footer-widget-wrapper"><div class="' . $footer_widget_wrapper_class . '">';
dynamic_sidebar('footer-widget');
echo '</div></div><!--end .footer-widget-wrapper -->';
calibrefx_put_wrapper('footer-widget', 'close');
echo '</div><!--end #footer-widget-->';
}
}
示例8: fbwidget_deactivate
function fbwidget_deactivate()
{
delete_option('widget_fbw_id');
unregister_sidebar('facebook_widget');
global $current_user;
$user_id = $current_user->ID;
delete_user_meta($user_id, 'fb_ignore_notice');
}
示例9: unregistered_sidebars_callback
function unregistered_sidebars_callback()
{
if ($GLOBALS['_unregister_sidebars']) {
foreach ($GLOBALS['_unregister_sidebars'] as $sidebar) {
unregister_sidebar($sidebar);
}
}
unset($GLOBALS['_unregister_sidebars']);
}
示例10: utility_pro_setup
/**
* Theme setup.
*
* Attach all of the site-wide functions to the correct hooks and filters. All
* the functions themselves are defined below this setup function.
*
* @since 1.0.0
*/
function utility_pro_setup()
{
define('CHILD_THEME_NAME', 'utility-pro');
define('CHILD_THEME_URL', 'https://store.carriedils.com/utility-pro');
define('CHILD_THEME_VERSION', '1.0.0');
// Add HTML5 markup structure
add_theme_support('html5', array('caption', 'comment-form', 'comment-list', 'gallery', 'search-form'));
// Add viewport meta tag for mobile browsers
add_theme_support('genesis-responsive-viewport');
// Add support for custom background
add_theme_support('custom-background', array('wp-head-callback' => '__return_false'));
// Add support for three footer widget areas
add_theme_support('genesis-footer-widgets', 3);
// Add support for additional color style options
add_theme_support('genesis-style-selector', array('utility-pro-purple' => __('Purple', 'utility-pro'), 'utility-pro-green' => __('Green', 'utility-pro'), 'utility-pro-red' => __('Red', 'utility-pro')));
// Add support for structural wraps (all default Genesis wraps unless noted)
add_theme_support('genesis-structural-wraps', array('footer', 'footer-widgets', 'header', 'home-gallery', 'nav', 'site-inner', 'site-tagline'));
// Add support for two navigation areas (theme doesn't use secondary navigation)
add_theme_support('genesis-menus', array('primary' => __('Primary Navigation Menu', 'utility-pro')));
// Add custom image sizes
add_image_size('feature-large', 960, 330, array('center', 'center'));
add_image_size('feature-post', 1144);
add_image_size('feature-post-archive', 743, 458, array('center', 'center'));
add_image_size('feature-post-home', 360, 223, array('center', 'center', true));
add_image_size('feature-rss', 564);
add_image_size('yarpp-thumbnail', 360, 223, array('center', 'center', true));
// Unregister secondary sidebar
unregister_sidebar('sidebar-alt');
// Unregister layouts that use secondary sidebar
genesis_unregister_layout('content-sidebar-sidebar');
genesis_unregister_layout('sidebar-content-sidebar');
genesis_unregister_layout('sidebar-sidebar-content');
// Register the default widget areas
utility_pro_register_widget_areas();
// Add Utility Bar above header
add_action('genesis_before_header', 'utility_pro_add_bar');
// Add featured image above posts
// Add a navigation area above the site footer
add_action('genesis_before_footer', 'utility_pro_do_footer_nav');
// Remove Genesis archive pagination (Genesis pagination settings still apply)
remove_action('genesis_after_endwhile', 'genesis_posts_nav');
// Add WordPress archive pagination (accessibility)
// Load accesibility components if the Genesis Accessible plugin is not active
if (!utility_pro_genesis_accessible_is_active()) {
// Load skip links (accessibility)
include get_stylesheet_directory() . '/includes/skip-links.php';
}
// Apply search form enhancements (accessibility)
add_filter('get_search_form', 'utility_pro_get_search_form', 25);
// Load files in admin
if (is_admin()) {
// Add suggested plugins nag
include get_stylesheet_directory() . '/includes/suggested-plugins.php';
// Add theme license (don't remove, unless you don't want theme support)
include get_stylesheet_directory() . '/includes/theme-license.php';
}
}
示例11: test_register_and_unregister_sidebar
/**
* @see register_sidebar
* @see unregister_sidebar
*/
function test_register_and_unregister_sidebar()
{
global $wp_registered_sidebars;
$sidebar_id = 'wp-unit-test';
register_sidebar(array('id' => $sidebar_id));
$this->assertArrayHasKey($sidebar_id, $wp_registered_sidebars);
unregister_sidebar($sidebar_id);
$this->assertArrayNotHasKey('wp-unit-test', $wp_registered_sidebars);
}
示例12: bsg_nav_remove_genesis_header
function bsg_nav_remove_genesis_header()
{
unregister_sidebar('header-right');
remove_action('genesis_site_title', 'genesis_seo_site_title');
remove_action('genesis_site_description', 'genesis_seo_site_description');
remove_action('genesis_header', 'genesis_header_markup_open', 5);
remove_action('genesis_header', 'genesis_do_header');
remove_action('genesis_header', 'genesis_header_markup_close', 15);
}
示例13: thaibloom_widgets_init
function thaibloom_widgets_init()
{
// remove second and third footer sidebars
unregister_sidebar('sidebar-1');
unregister_sidebar('sidebar-2');
unregister_sidebar('sidebar-3');
register_sidebar(array('name' => __('Header Area', 'twentyeleven'), 'id' => 'header-widget', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => __('Footer Area', 'twentyeleven'), 'id' => 'footer-widget', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => __('Blog Peripheral', 'twentyeleven'), 'id' => 'blog-peripheral', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
示例14: unregister_genesis_widgets
function unregister_genesis_widgets()
{
unregister_widget('Genesis_eNews_Updates');
unregister_widget('Genesis_Featured_Page');
unregister_widget('Genesis_Featured_Post');
unregister_widget('Genesis_Latest_Tweets_Widget');
unregister_widget('Genesis_Menu_Pages_Widget');
unregister_widget('Genesis_User_Profile_Widget');
unregister_widget('Genesis_Widget_Menu_Categories');
unregister_sidebar('header-right');
}
示例15: polarlite_widgets_init
function polarlite_widgets_init()
{
unregister_sidebar('sidebar-area');
unregister_sidebar('home_sidebar_area');
unregister_sidebar('category-sidebar-area');
unregister_sidebar('bottom-sidebar-area');
register_sidebar(array('name' => 'Sidebar', 'id' => 'sidebar-area', 'description' => 'This sidebar will be shown after the contents.', 'before_widget' => '<div class="pin-article span4"><div class="widget-box">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Home Sidebar', 'id' => 'home_sidebar_area', 'description' => __("This sidebar will be shown for the homepage", "wip"), 'before_widget' => '<div class="pin-article span4"><div class="widget-box">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Category Sidebar', 'id' => 'category-sidebar-area', 'description' => 'This sidebar will be shown after the content.', 'before_widget' => '<div class="pin-article span4"><div class="widget-box">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Bottom Sidebar', 'id' => 'bottom-sidebar-area', 'description' => 'This sidebar will be shown after the content.', 'before_widget' => '<div class="span3"><div class="widget-box">', 'after_widget' => '</div></div>', 'before_title' => '<h4 class="title">', 'after_title' => '</h4>'));
}