About the param of the admin_enqueue_scripts hook in WordPress

The typical code using admin_enqueue_scripts is
add_action( 'admin_enqueue_scripts', 'enqueue_assets');

function enqueue_assets( $suffix ) {
    wp_enqueue_style( 'baidu-translator-admin' );
}     

The question is what the param suffix refer to? After adding a 'echo' sentence, I got the print.
function enqueue_assets( $suffix ) {
    echo $suffix;
    wp_enqueue_style( 'baidu-translator-admin);
}  

The print is:
settings_page_baidu-translator

The id of the page added by add_option_page is 'baidu-translator'. So the param suffix refers to a screen id which consists of the id of parent page and current option page.

评论

此博客中的热门博文

Configure shadowsocks transparent proxy + gfwlist(PAC) on OpenWRT Router

Openwrt路由器上配置shadowsocks透明代理+gfwlist(PAC)

Configure V2Ray(Shadowsocks mode) + 加速:普通BBR/魔改BBR on KVM VPS (Tested on Ubuntu 16.04)