管理画面(ダッシュボード)のどこにいるかを知りたいということと仮定して回答します。
管理画面は、get_current_screen()
関数で、どのメニューを実行したか判断することはできます。(get_current_screen 関数は、管理画面以外では定義されないので、通常画面ではエラーになります。)
get_current_screen()
を実行すると
WP_Screen::__set_state(array(
'action' => '',
'base' => 'edit',
'columns' => 0,
'id' => 'edit-acf-field-group',
'in_admin' => 'site',
'is_network' => false,
'is_user' => false,
'parent_base' => 'edit',
'parent_file' => 'edit.php?post_type=acf-field-group',
'post_type' => 'acf-field-group',
'taxonomy' => '',
(以下略)
))
のような配列が返ってきますので、含まれている内容で判別します。
上記は、ACF の「フィールドグループ」( 例: http://example.com/wp-admin/edit.php?post_type=acf-field-group ) を開いた際の内容です。
post_type
が、acf-field-group
になっているので、ACF 関連の画面と判断できます。
あとは、id
や parent_base
や parent_file
等で特定します。
get_current_screen 関数については、Function Reference/get_current_screen 参照。