WordPress配置:如何设置钩子来设置定义



我想做一个插件,可以设置一些定义,比如WP_HOME、WP_DATABASE等。

我想你可以使用init(或admin_init,取决于你需要它的地方)钩子。 http://codex.wordpress.org/Plugin_API/Action_Reference/init

add_action('init', 'loadConstants');
function loadConstants() {
//WP_HOME and other goes here
}

最新更新