直接函数回调

add_action( 'init', function() {
    // do something here
} );

使用功能块挂钩一组指令。使用 init 钩子,在 wordpress 完成加载必要组件后立即执行指令集。