本文整理汇总了PHP中GoogleSitemapGeneratorLoader::SetupRewriteHooks方法的典型用法代码示例。如果您正苦于以下问题:PHP GoogleSitemapGeneratorLoader::SetupRewriteHooks方法的具体用法?PHP GoogleSitemapGeneratorLoader::SetupRewriteHooks怎么用?PHP GoogleSitemapGeneratorLoader::SetupRewriteHooks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoogleSitemapGeneratorLoader
的用法示例。
在下文中一共展示了GoogleSitemapGeneratorLoader::SetupRewriteHooks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetVersion
*/
public static function GetVersion()
{
if (!isset($GLOBALS["sm_version"])) {
if (!function_exists('get_plugin_data')) {
if (file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
} else {
return "0.ERROR";
}
}
$data = get_plugin_data(self::GetPluginFile(), false, false);
$GLOBALS["sm_version"] = $data['Version'];
}
return $GLOBALS["sm_version"];
}
public static function GetSvnVersion()
{
return self::$svnVersion;
}
}
//Enable the plugin for the init hook, but only if WP is loaded. Calling this php file directly will do nothing.
if (defined('ABSPATH') && defined('WPINC')) {
add_action("init", array("GoogleSitemapGeneratorLoader", "Enable"), 15, 0);
register_activation_hook(sm_GetInitFile(), array('GoogleSitemapGeneratorLoader', 'ActivatePlugin'));
register_deactivation_hook(sm_GetInitFile(), array('GoogleSitemapGeneratorLoader', 'DeactivatePlugin'));
//Set up hooks for adding permalinks, query vars.
//Don't wait until init with this, since other plugins might flush the rewrite rules in init already...
GoogleSitemapGeneratorLoader::SetupQueryVars();
GoogleSitemapGeneratorLoader::SetupRewriteHooks();
}