WordPress 101 主题开发教程: 15 – 通过WalkerClass编辑菜单 Part 2

WordPress 101 – Part 15: Edit the menu with the Walker Class – Part 2

视频学习参考: https://www.youtube.com/watch?v=bTp3Pt_RQmA&list=PLriKzYyLb28nUFbe0Y9d-19uVkOnhYxFE&index=15

1.apply_filters 过滤器

function test_func(){
    return '修改值';
}
add_filter( 'test', 'test_func' );
echo apply_filters( 'test', '可以被修改的值' );

2. start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { … }

好麻烦啊 这个方法应该应用不广泛吧 好难写!

Everything is wonderful and beautiful!