acf_is_screen()ACF 5.1.5

acf_is_screen

This function will return true if all args are matched for the current screen

Хуков нет.

Возвращает

$post_id. (int)

Использование

acf_is_screen( $id );
$id **
-
По умолчанию: ''

Список изменений

С версии 5.1.5 Введена.

Код acf_is_screen() ACF 6.0.4

function acf_is_screen( $id = '' ) {

	// bail early if not defined
	if ( ! function_exists( 'get_current_screen' ) ) {
		return false;
	}

	// vars
	$current_screen = get_current_screen();

	// no screen
	if ( ! $current_screen ) {
		return false;

		// array
	} elseif ( is_array( $id ) ) {
		return in_array( $current_screen->id, $id );

		// string
	} else {
		return ( $id === $current_screen->id );
	}
}