do_action( 'widgets_init' )

Fires after all default WordPress widgets have been registered.


Description Description


Source Source

File: wp-includes/widgets.php

View on Trac


Top ↑

Changelog Changelog

Changelog
Version Description
2.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Vail Joy

    For example, used with registering sidebars:

    function mytheme_widgets_init() {
    	register_sidebar( array(
    		'name'          => __( 'Single Post Widgets', 'textdomain' ),
    		'id'            => 'mytheme-single-post-widgets',
    		'description'   => __( 'Widgets in this area will be shown under your single posts, before comments.', 'textdomain' ),
    		'before_widget'	=> '',
    		'after_widget'	=> '',
    		'before_title'	=> '',
    		'after_title'	=> '',
        ) );
    }
    add_action( 'widgets_init', 'mytheme_widgets_init' );
    

You must log in before being able to contribute a note or feedback.