例如,通过挂钩或过滤器?我什么也没找到。
我需要换个地方。
add_action( \'post_submitbox_misc_actions\', \'show_current_filter\' );
add_action( \'post_submitbox_start\', \'show_current_filter\' );
function show_current_filter()
{
$post = get_post();
print \'<pre>\' . $post->ID . \' : \' . current_filter() . \'</pre>\';
}
我使用这个钩子只允许管理员角色访问仪表板add_action( \'admin_init\', function() { if ( defined(\'DOING_AJAX\') && DOING_AJAX ) { return; } if ( !current_user_can(\'manage_options\') ) { wp_redirect( home_url(\'/meu-