當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPSEO_Options::initialize方法代碼示例

本文整理匯總了PHP中WPSEO_Options::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPSEO_Options::initialize方法的具體用法?PHP WPSEO_Options::initialize怎麽用?PHP WPSEO_Options::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPSEO_Options的用法示例。


在下文中一共展示了WPSEO_Options::initialize方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: wpseo_activate

/**
 * 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');
}
開發者ID:Ingenex,項目名稱:redesign,代碼行數:15,代碼來源:wp-seo-main.php

示例2: wpseo_defaults

/**
 * 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();
}
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:12,代碼來源:wpseo-non-ajax-functions.php

示例3: __construct

 /**
  * Class constructor
  *
  * @param boolean $replace
  */
 public function __construct($replace = false)
 {
     $this->replace = $replace;
     WPSEO_Options::initialize();
 }
開發者ID:goodbayscott,項目名稱:wwr-temp,代碼行數:10,代碼來源:class-import-external.php

示例4: _wpseo_activate

/**
 * 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');
}
開發者ID:misfist,項目名稱:missdrepants-network,代碼行數:25,代碼來源:wp-seo-main.php

示例5: check_admin_referer

 *
 * @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');
開發者ID:rinodung,項目名稱:myfreetheme,代碼行數:31,代碼來源:import.php

示例6: _wpseo_activate

/**
 * 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');
}
開發者ID:UPMediaDesign,項目名稱:vidaestudiantilip,代碼行數:22,代碼來源:wp-seo-main.php


注:本文中的WPSEO_Options::initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。