本文整理汇总了PHP中CF7DBPlugin::addActionsAndFilters方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::addActionsAndFilters方法的具体用法?PHP CF7DBPlugin::addActionsAndFilters怎么用?PHP CF7DBPlugin::addActionsAndFilters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::addActionsAndFilters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CF7DBPlugin_init
function CF7DBPlugin_init($file)
{
require_once 'CF7DBPlugin.php';
$aPlugin = new CF7DBPlugin();
// Install the plugin
// NOTE: this file gets run each time you *activate* the plugin.
// So in WP when you "install" the plugin, all that does it dump its files in the plugin-templates directory
// but it does not call any of its code.
// So here, the plugin tracks whether or not it has run its install operation, and we ensure it is run only once
// on the first activation
if (!$aPlugin->isInstalled()) {
$aPlugin->install();
} else {
// Perform any version-upgrade activities prior to activation (e.g. database changes)
$aPlugin->upgrade();
}
// Add callbacks to hooks
$aPlugin->addActionsAndFilters();
if (!$file) {
$file = __FILE__;
}
// Register the Plugin Activation Hook
register_activation_hook($file, array(&$aPlugin, 'activate'));
// Register the Plugin Deactivation Hook
register_deactivation_hook($file, array(&$aPlugin, 'deactivate'));
}