直接函式回撥

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

使用功能塊掛鉤一組指令。使用 init 鉤子,在 wordpress 完成載入必要元件後立即執行指令集。