Hook into register_sidebar
and change the name after the sidebar was registered.
Example:
add_action( 'register_sidebar', function( $sidebar )
{
global $wp_registered_sidebars;
if ( 'Main Sidebar' !== $sidebar[ 'name' ] )
return;
$id = $sidebar[ 'id' ];
$sidebar[ 'name' ] = 'Master';
$wp_registered_sidebars[ $id ] = $sidebar;
});
There is no need to unregister the original if you want to change just the name.
You can change other properties too:
description
class
before_widget
,after_widget
before_title
,after_title
Related Posts:
- Check if has any sidebar active on current page
- Dynamically Register Sidebars For Each Top Level Page
- add sidebar area to header of child theme
- Advice: Template structure – php blocks in sidebar or someting else?
- Make “sidebar template” the default template for new pages
- Missing argument 2 for a custom function widgets_init
- is_dynamic_sidebar always returns true while using Jetpack visibility
- How to insert custom widget in custom sidebar in theme activation?
- Display post shortcode content in the sidebar?
- Best practices regarding the creation of custom widgets?
- How do you Permanently Delete Sidebars
- Custom Sidebar only on single post
- Is `is_sidebar_active()` deprecated, and showing error?
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- Why is it so hard to add a class to the tag in the sidebar widget?
- Best way to disable sidebars on posts (only)?
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- New checkbox in custom widget isn’t saving data
- Multiple, Dynamic, Sidebars Problem – First Sidebar not working properly
- How do you insert code into the sidebar?
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Trying to Add a LEFT Sidebar?
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- unregister_sidebar in child theme not working
- Additional Sidebar
- Add the title of a widget as an ID – for anchor links
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Issue with wp_get_attachment_image() and SVG file type
- deregister scripts on certain page
- How to create a widgetized sidebar for every category dynamically?
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Using get_terms for custom taxonomy in functions.php
- How to remove the embed_footer?
- Removing title from page
- get_the_excerpt() not returning anything when post has no excerpt
- Why isn’t is_page_template() adding a body class?
- Query children and parent title
- Creating loop within functions.php
- Limit filter upgrader_post_install to a single plugin
- creating shortcode to pull json array
- Still relevant method of embedding images in WP Theme in 2018
- Pass Shortcode Attribute to footer Script
- post to subcategory and parent in wp_insert_post
- Variable if post is sticky in functions.php
- Create a new query in function.php to filter blog posts
- Use third party Library in wordpress
- Remove the product category module block from the Woocommerce product page
- Creating new blog on multisite programatically without hacks?
- Allowing users to view private posts (pending approval)
- How to get correct URLs in network wide menu (Multisite)?
- Remove category from url
- ‘Attempt to modify property of non-object’ warning
- Conditional functions.php on page template
- Optimizing a WordPress site
- different style sheet for just one page template
- Problem with comments_number()
- How to add custom JavaScript in functions?
- How to target post and pages and not all post types in admin?
- hide shortcode using hooks
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Adding code using functions.php in child theme
- Passing global variable from header.php to functions.php
- Page get parameter doesn’t work with is_single() function
- How is $current_page passed in woocommerce_account_orders function?
- Upgraded server now class My_Walker_Nav_Menu extends Walker_Nav_Menu not working
- Filter to wp_list_authors
- Contact Form 7 If Condition
- How to include any template using Shortcode fuction?
- display a div on ervery site but not frontpage?
- How can I change the size of the text in Word Press
- Using depth=n in wp_list_pages
- shorthand syntax for custom fields
- How do I pull avatar from post using BuddyPress? [closed]
- Replace header image on all other pages but home – URL issue
- Get users with different roles and call function on each of them (user_meta)
- Getting images from media library and get_the_date() not working
- Show errormessages on wrong username/password on custom loginform?
- Using add_image_size in functions.php to get original uploaded file
- How do I change where “You must be logged in to comment” directs users?
- Login cookies blocked after customizing hashing method
- Class parameter in get_avatar args doesn’t get added to output
- Enable CORS Request for hostname using IP address
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- locking content with overlay/pop up ads
- How to use `foreach()` in ajax call
- Change default color scheme in twentyfifteen child theme?
- Restrict access if logged out except for homepage
- DISABLE wordpress upgrade page
- How to list out all values from the get_body_class array
- Moving CDN jQuery to footer does not work?
- Mail function not working with user accounts
- Function not recognizing page id?
- Register a widget area when a theme option has been saved?
- Blank child theme – functions.php problem
- Conditionally write open graph meta property in header
- Pull random comment from specific post, display on homepage with shortcode
- Give a function a unique ID
- Hiding Google Analytics code based on theme options
- Setcookie not setting cookies anywhere except admin
- WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories