本文整理汇总了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');
}
示例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();
}
示例3: __construct
/**
* Class constructor
*
* @param boolean $replace
*/
public function __construct($replace = false)
{
$this->replace = $replace;
WPSEO_Options::initialize();
}
示例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');
}
示例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');
示例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');
}