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.

评论

此博客中的热门博文

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

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

Using Haproxy + shadowsocks (ha + ss) to setup multi ss backend and load balance