After searching under the tag widget and Google the closest I have found that populates what I am looking for is this article: Is there a way to allow only certain type of widgets in the sidebars?
I also found this page: How to add a specific widget to only 1 page?.
I reviewed the codex for dynamic_sidebar()
and register_sidebar()
but I do not see a way when someone goes to the Widgets Panel and under the Available Widgets area you can limit what location a widget can be applied to.
Question: If I want the Tag Cloud widget to only be allowed in a certain registered sidebar, in this case foobar
where do I restrict what is allowed?
// Custom widget area for foobar.
if ( function_exists( 'register_sidebar' ) ) {
register_sidebar( array(
'name' => __( 'Foobar Sidebar', 'text_domain'),
'id' => 'widget-foobar',
'description' => __( 'A custom widget area for foobar', 'text_domain' ),
'before_widget' => 'some-code',
'after_widget' => 'some-code',
'before_title' => 'some-code',
'after_title' => 'some-code',
));
}
Or how I can limit custom and default widgets for certain areas I've registered?