add_action( 'widgets_init', 'Y_widget_register' );
You have a typo – use underscores.
Here is the working piece:
function Y_widget_register() {
register_sidebar(array(
'name' => esc_html__('Sidebar', 'Y-07'),
'id' => 'y-sidebar',
'description' => 'Dynamic Right Sidebar',
'before_widget' => '<section id="%1$s" class="y-widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="y-widget-title">',
'after_title' => '</h2>'
));
}
add_action('widgets_init', 'Y_widget_register');
Related Posts:
- How do I Make a Theme “plugin-ready”?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Should action callbacks start with a verb?
- How to hook a custom user function to a wordpress core ajax action?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Difference Between Filter and Action Hooks?
- framework for plugin/theme options panel? [closed]
- How to get the path to the current theme?
- ajaxurl not defined on front end
- What process do you use for WordPress development? [closed]
- Why does WordPress use outdated jQuery v1.12.4?
- What is the advantage of using wp_mail?
- How to create an API for my plugin?
- How to override existing plugin action with new action
- Which hook should be used to add an action containing a redirect?
- Should Plugin Folders Include a Blank index.php File?
- WordPress Update Plugin Hook/Action? Since 3.9
- How to include jQuery and JavaScript files correctly?
- Single functions.php or split into many small files?
- How can I configure Docker for developing and deploying a custom theme?
- Where to store PHP files created by plugin / themes
- How to post data to same page in wordpress
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Which action for triggering cron “wp”or “init”?
- Understanding WordPress functions’ naming conventions
- What is the difference between esc_html and wp_filter_nohtml_kses?
- Should I create a theme or a plugin?
- add_action with a class method is causing fatal errors
- Include third party Javascript library which is not included in WordPress
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Where do I start from
- WP 3.3 Tooltips API?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- jQuery in header or footer
- Check for featured image in WP_Query
- add_filter OO with parameters
- How do I print a notice only on certain admin pages?
- Do I need to call do_action in my plugin?
- How Do I Load My Action Earlier Enough?
- Which to use to execute code during the saving of a plugin settings page?
- Does WP fire delete_post when trashed posts are automatically deleted?
- wp_remote_get doesn’t work with secure connections https?
- What’s the earliest point I can get the queried object ID?
- Update exisiting site to 3.5 release candidate
- Authoritative answer on which boots first – Plugins or Themes?
- How to Add Font Awesome Icons to WordPress Menus?
- A Post is saved twice or more during add_action(save_post)
- How to Add a .js file Only in one specific Page Dynamically to Head
- Show a user their recently viewed posts
- Escaping built-in WP function return strings
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- Actions or filters fired when data is saved in a custom table
- In a plugin, why is add_action(‘init’) not executed before the plugin is activated?
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Having Problem On Getting WP Post Gallery Images URL
- How to create custom home page via plugin?
- Add new user and add meta at once
- What action is called when drafts are saved?
- How to: get main plugin/theme file?
- How to debug WordPress correctly?
- Is it possible to create an action hook using do_action() within add_action()?
- Custom user profile, registration, login page with theme
- add_theme_support using a plugin
- How can I hook into existing WordPress Bulk actions?
- When is it too late to call the action wp_enqueue_scripts?
- Featured Image not showing in admin
- Odd behaviour with submenu link creation
- How to Display Custom Post Type’s Gallery (images ) in Through WP_Query
- Customizer Not Saving Options
- How to bundle a plugin with a theme, or vice versa
- What is the Difference between directly call a function and call a function using add_action?
- What is better way to use Bootstrap inside admin panel?
- How to add custom content under plugin row in WordPress admin plugin list?
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Whats the difference between blog_info(‘stylesheet_url’) difference get_stylesheet_uri()
- Define a function outside a class and call the function using action or filter hook
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- What’s the better way to add an inline script?
- What function to hook for changes made in status and visibility of a post
- Create a plugin to change the action to which a function is hooked
- Example of uninstaller routine to remove all custom theme options from wp_options
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Paging on a future post loop?
- Modifying values with add_action to be sent to db
- Woocommerce – Hide a Column in Cart Table
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Backslashes being stripped from CSS
- How to redirect to action on custom page within admin section
- Best choice of options/settings framework for plugin/theme development
- What for the tables ending with the meta used in database of wordpress?
- How to determine if the current file is loaded in a plugin or in a theme?