本文整理汇总了PHP中WPSEO_Meta::init方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSEO_Meta::init方法的具体用法?PHP WPSEO_Meta::init怎么用?PHP WPSEO_Meta::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPSEO_Meta
的用法示例。
在下文中一共展示了WPSEO_Meta::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpseo_init
/**
* On plugins_loaded: load the minimum amount of essential files for this plugin
*/
function wpseo_init()
{
require_once WPSEO_PATH . 'inc/wpseo-functions.php';
// Make sure our option and meta value validation routines and default values are always registered and available.
WPSEO_Options::get_instance();
WPSEO_Meta::init();
$options = WPSEO_Options::get_options(array('wpseo', 'wpseo_permalinks', 'wpseo_xml'));
if (version_compare($options['version'], WPSEO_VERSION, '<')) {
new WPSEO_Upgrade();
// Get a cleaned up version of the $options.
$options = WPSEO_Options::get_options(array('wpseo', 'wpseo_permalinks', 'wpseo_xml'));
}
if ($options['stripcategorybase'] === true) {
$GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
}
if ($options['enablexmlsitemap'] === true) {
$GLOBALS['wpseo_sitemaps'] = new WPSEO_Sitemaps();
}
if (!defined('DOING_AJAX') || !DOING_AJAX) {
require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
}
// Init it here because the filter must be present on the frontend as well or it won't work in the customizer.
new WPSEO_Customizer();
}
示例2: wpseo_init
/**
* On plugins_loaded: load the minimum amount of essential files for this plugin
*/
function wpseo_init()
{
require_once WPSEO_PATH . 'inc/wpseo-functions.php';
// Make sure our option and meta value validation routines and default values are always registered and available
WPSEO_Options::get_instance();
WPSEO_Meta::init();
$options = WPSEO_Options::get_all();
if (version_compare($options['version'], WPSEO_VERSION, '<')) {
new WPSEO_Upgrade();
// get a cleaned up version of the $options
$options = WPSEO_Options::get_all();
}
if ($options['stripcategorybase'] === true) {
$GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
}
if ($options['enablexmlsitemap'] === true) {
$GLOBALS['wpseo_sitemaps'] = new WPSEO_Sitemaps();
}
if (!defined('DOING_AJAX') || !DOING_AJAX) {
require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
}
}