Пример #1
0
/**
 * Runs on activation of the plugin.
 */
function wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    WPSEO_Options::get_instance();
    WPSEO_Options::initialize();
    flush_rewrite_rules();
    wpseo_add_capabilities();
    WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'));
    // Clear cache so the changes are obvious.
    WPSEO_Options::clear_cache();
    do_action('wpseo_activate');
}
/**
 * Set the default settings.
 *
 * @deprecated 1.5.0
 * @deprecated use WPSEO_Options::initialize()
 * @see        WPSEO_Options::initialize()
 */
function wpseo_defaults()
{
    _deprecated_function(__FUNCTION__, 'WPSEO 1.5.0', 'WPSEO_Options::initialize()');
    WPSEO_Options::initialize();
}
 /**
  * Class constructor
  *
  * @param boolean $replace
  */
 public function __construct($replace = false)
 {
     $this->replace = $replace;
     WPSEO_Options::initialize();
 }
Пример #4
0
/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults.
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    if (is_multisite() && ms_is_switched()) {
        delete_option('rewrite_rules');
    } else {
        add_action('shutdown', 'flush_rewrite_rules');
    }
    wpseo_add_capabilities();
    // Clear cache so the changes are obvious.
    WPSEO_Utils::clear_cache();
    do_action('wpseo_activate');
}
Пример #5
0
 *
 * @todo [Yoast] The import for the RSS Footer plugin checks for data already entered via WP SEO,
 * the other import routines should do that too.
*/
global $wpseo_admin_pages;
$msg = '';
if (isset($_POST['import']) || isset($_GET['import'])) {
    check_admin_referer('wpseo-import');
    global $wpdb;
    $replace = false;
    $deletekw = false;
    if (isset($_POST['wpseo']['deleteolddata']) && $_POST['wpseo']['deleteolddata'] == 'on') {
        $replace = true;
    }
    if (isset($_POST['wpseo']['importwoo'])) {
        WPSEO_Options::initialize();
        $sep = get_option('seo_woo_seperator');
        $options = get_option('wpseo_titles');
        switch (get_option('seo_woo_home_layout')) {
            case 'a':
                $options['title-home-wpseo'] = '%%sitename%% ' . $sep . ' %%sitedesc%%';
                break;
            case 'b':
                $options['title-home-wpseo'] = '%%sitename%% ' . get_option('seo_woo_paged_var') . ' %%pagenum%%';
                break;
            case 'c':
                $options['title-home-wpseo'] = '%%sitedesc%%';
                break;
        }
        if ($replace) {
            delete_option('seo_woo_home_layout');
/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    flush_rewrite_rules();
    wpseo_add_capabilities();
    WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'));
    // Clear cache so the changes are obvious.
    WPSEO_Options::clear_cache();
    do_action('wpseo_activate');
}