I guess you are looking only for Welcome widget. The first widget (HTML) in sidebar. If so than you can get it with below code
/*
* Override 'sidepanel' method into your theme or plugin file
*/
public function sidepanel()
{
// perform check for logged in user
// if not logged in than unset the sidebar
if ( ! qa_is_logged_in() )
{
unset($this->content['sidebar']);
}
//load the default sidepanel
qa_html_theme_base::sidepanel();
}
If you are looking for all other HTML widget than you can find those into $this->content array. For example for HTML on top (header) the element (key) is body_head etc. So you need to find and unset it with the same way as above.
If you are advanced PHP user than you can use array to perform multiple check at one, which will optimize the code.
Update
Note: Removed ! from qa_is_logged_in so the code will only work for logged in user. ( edited on 09/03/2015 )
public function head_script()
{
if ( qa_is_logged_in() ) {
// your javascript
// see custom-html id on footer()
$('#custom-html').yourcode
}
qa_html_theme_base::head_script();
}
public function footer()
{
/*
* This is the element (div) where your conent from javascript will load
* Probably your chatbox markup
*/
if ( qa_is_logged_in() ) {
// see custom-html id in javascript
$this->output('<div id="custom-html"></div>');
}
qa_html_theme_base::footer();
}