本文整理汇总了PHP中settings::addHooks方法的典型用法代码示例。如果您正苦于以下问题:PHP settings::addHooks方法的具体用法?PHP settings::addHooks怎么用?PHP settings::addHooks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::addHooks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialisePlugin
public static function initialisePlugin()
{
// NB Network activation will not upgrade a site
// do upgrade will check current upgrade script version and apply as necessary
upgrader::checkUpgrade();
// 2 is required for $file to be populated
add_filter('plugin_row_meta', array(__CLASS__, 'filter_plugin_row_meta'), 10, 2);
add_action('do_robots', array(__CLASS__, 'addRobotLinks'), 100, 0);
add_action('wp_head', array(__CLASS__, 'addRssLink'), 100);
// only include admin files when necessary.
if (is_admin()) {
include_once 'settings.php';
include_once 'postMetaData.php';
include_once 'categoryMetaData.php';
settings::addHooks();
categoryMetaData::addHooks();
postMetaData::addHooks();
}
if (!wp_get_schedule('xmsg_ping')) {
// ping in 2 hours from when setup.
wp_schedule_event(time() + 60 * 60 * 2, 'daily', 'xmsg_ping');
}
add_action('xmsg_ping', array(__CLASS__, 'doPing'));
// NB Network activation will not have set up the rules for the site.
// Check if they exist and then reactivate.
if (get_option(RULES_OPTION_NAME, null) != RULES_VERSION) {
add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1);
}
}