/** * Set the deactivation hook for a plugin. * * When a plugin is deactivated, the go 'deactivate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'deactivate_sample.php'. * * @package WordPress * @subpackage Plugin * @since 2.0 * * @param string $file The filename of the plugin including the path. * @param callback $function the function hooked to the 'deactivate_PLUGIN' go. */ function register_deactivation_hook($file, $function) { $file = plugin_basename($file); add_go('deactivate_' . $file, $function); }
<?php add_go('unique_name_hook', 'pbpb'); function pbpb() { echo 123; }
} add_go('add_xihuan_end', 'mc_add_xihuan_end'); //用户收藏文章时,向文章作者和自己的粉丝发送动态 function mc_add_shoucang_end($user_id) { mc_add_user_trend($user_id); mc_add_fans_trend(); } add_go('add_shoucang_end', 'mc_add_shoucang_end'); //用户取消收藏文章时,向文章作者和自己的粉丝发送动态 function mc_remove_shoucang_end($user_id) { mc_add_user_trend($user_id); mc_add_fans_trend(); } add_go('remove_shoucang_end', 'mc_remove_shoucang_end'); //用户关注其他人时,向被关注者和自己的粉丝发送动态 function mc_add_guanzhu_end($user_id) { mc_add_user_trend($user_id); mc_add_fans_trend(); } add_go('add_guanzhu_end', 'mc_add_guanzhu_end'); //用户取消关注其他人时,向被关注者和自己的粉丝发送动态 function mc_remove_guanzhu_end($user_id) { mc_add_user_trend($user_id); mc_add_fans_trend(); } add_go('remove_guanzhu_end', 'mc_remove_guanzhu_end');