I've got this error when I activated one plugin. I'm not a professional programmer, but I have some php experience. Help me please. The error is in the if ( in_array('template-widget', $widgets)) { line.
function ActionWpPrintScripts() {
global $post;
// Check to see if widget is present on page
$sidebars_widgets = wp_get_sidebars_widgets(false);
$widget_loaded = false;
if ( is_array($sidebars_widgets) ) {
foreach ( $sidebars_widgets as $sidebar => $widgets ) {
if ( in_array('template-widget', $widgets)) {
$widget_loaded = true;
}
}
}
}
var_dumpon$widgetsand make sure it is an arraywp_get_sidebars_widgetsfunction. The wordpress and wordpress-plugin tags seem appropriate to me.$widgets