id = 0; $result->module = $name; $result->params = ''; if (isset($wp_widget_factory->widgets[$classname])) { // get settings of all the widgets of this type $settings = $wp_widget_factory->widgets[$classname]->get_settings(); if ($settings) { // take only the first one $result->id = key($settings); $result->params = reset($settings); // JSON encode params for Joomla compatibility $result->params = json_encode($result->params); } } return $result; } }