Ejemplo n.º 1
0
    /**
     * Callback for plugin activation, outputs admin notice
     *
     * @since 1.0
     */
    function activation()
    {
        if (false == searchwp_get_setting('activated')) {
            searchwp_set_setting('activated', 1);
            // reset the counts
            if (class_exists('SearchWPIndexer')) {
                $indexer = new SearchWPIndexer();
                $indexer->updateRunningCounts();
            }
            ?>
			<div class="updated">
				<p><?php 
            _e('SearchWP has been activated and the index is now being built. <a href="options-general.php?page=searchwp">View progress and settings</a>', 'searchwp');
            ?>
</p>
			</div>
			<?php 
            // trigger the initial indexing
            do_action('searchwp_log', 'Request index (activation)');
            $this->triggerIndex();
        }
    }