acf_get_post_type_from_request_args()ACF 6.1.5

Gets an ACF post type from request args and verifies nonce based on action.

Хуков нет.

Возвращает

Массив|true|false.

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

acf_get_post_type_from_request_args( $action );
$action(строка)
The action being performed.
По умолчанию: ''

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

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

Код acf_get_post_type_from_request_args() ACF 6.4.2

function acf_get_post_type_from_request_args( $action = '' ) {
	$acf_use_post_type = (int) acf_request_arg( 'use_post_type', 0 );

	if ( ! $acf_use_post_type || ! wp_verify_nonce( acf_request_arg( '_wpnonce' ), $action . '-' . $acf_use_post_type ) ) {
		return false;
	}

	return acf_get_internal_post_type( $acf_use_post_type, 'acf-post-type' );
}