/**
  * Register widget with WordPress.
  */
 function __construct()
 {
     parent::__construct('wpsolr_widget_facets', __('WPSOLR Facets', 'wpsolr_admin'), array('description' => __('Display Solr Facets', 'wpsolr_admin')));
 }
require_once 'classes/utilities/WPSOLR_Global.php';
/* UI Facets */
require_once 'classes/ui/WPSOLR_UI_Facets.php';
/* Register Solr settings from dashboard
 * Add menu page in dashboard - Solr settings
 * Add solr settings- solr host, post and path
 *
 */
add_action('wp_head', 'check_default_options_and_function');
add_action('admin_menu', 'fun_add_solr_settings');
add_action('admin_init', 'wpsolr_admin_init');
add_action('wp_enqueue_scripts', 'my_enqueue');
// Register WpSolr widgets when current theme's search is used.
if (WPSOLR_Global::getOption()->get_search_is_use_current_theme_search_template()) {
    require_once 'classes/ui/widget/WPSOLR_Widget.php';
    WPSOLR_Widget::Autoload();
}
/*
 * Display Solr errors in admin when a save on a post can't index to Solr
 */
function solr_post_save_admin_notice()
{
    if ($out = get_transient(get_current_user_id() . 'error_solr_post_save_admin_notice')) {
        delete_transient(get_current_user_id() . 'error_solr_post_save_admin_notice');
        echo "<div class=\"error\"><p>(WPSOLR) Error while indexing this post/page in Solr:<br><br>{$out}</p></div>";
    }
    if ($out = get_transient(get_current_user_id() . 'updated_solr_post_save_admin_notice')) {
        delete_transient(get_current_user_id() . 'updated_solr_post_save_admin_notice');
        echo "<div class=\"updated\"><p>(WPSOLR) {$out}</p></div>";
    }
    if ($out = get_transient(get_current_user_id() . 'wpsolr_some_languages_have_no_solr_index_admin_notice')) {