Title: Locations Global Functions
Published: February 21, 2025
Last modified: June 23, 2025

---

# Locations Global Functions

## In this article

 * [acf_register_location_type()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_register_location_type)
 * [acf_get_location_types()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_types)
 * [acf_get_location_type()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_type)
 * [acf_get_location_rule_types()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_types)
 * [acf_validate_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_validate_location_rule)
 * [acf_get_location_rule_operators()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_operators)
 * [acf_get_location_rule_values()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_values)
 * [acf_match_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_match_location_rule)
 * [acf_get_location_screen()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_screen)
 * [acf_register_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_register_location_rule)
 * [acf_get_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule)
 * [acf_get_valid_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_valid_location_rule)

[ Back to top](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#wp--skip-link--target)

## 󠀁[acf_register_location_type()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_register_location_type)󠁿

Registers a location type.

 * @date 8/4/20
 * @since ACF 5.9.0
 * @param string $class_name The location class name.
 * @return (ACF_Location|false)

## 󠀁[acf_get_location_types()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_types)󠁿

Returns an array of all registered location types.

 * @date 8/4/20
 * @since ACF 5.9.0
 * @return array

## 󠀁[acf_get_location_type()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_type)󠁿

Returns a location type for the given name.

 * @date 18/2/19
 * @since ACF 5.7.12
 * @param string $name The location type name.
 * @return (ACF_Location|null)

## 󠀁[acf_get_location_rule_types()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_types)󠁿

Returns a grouped array of all location rule types.

 * @date 8/4/20
 * @since ACF 5.9.0
 * @return array

## 󠀁[acf_validate_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_validate_location_rule)󠁿

Returns a validated location rule with all props.

 * @date 8/4/20
 * @since ACF 5.9.0
 * @param array $rule The location rule.
 * @return array

## 󠀁[acf_get_location_rule_operators()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_operators)󠁿

Returns an array of operators for a given rule.

 * @date 30/5/17
 * @since ACF 5.6.0
 * @param array $rule The location rule.
 * @return array

## 󠀁[acf_get_location_rule_values()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule_values)󠁿

Returns an array of values for a given rule.

 * @date 30/5/17
 * @since ACF 5.6.0
 * @param array $rule The location rule.
 * @return array

## 󠀁[acf_match_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_match_location_rule)󠁿

Returns true if the provided rule matches the screen args.

 * @date 30/5/17
 * @since ACF 5.6.0
 * @param array $rule The location rule.
 * @param array $screen The screen args.
 * @param array $field_group The field group array.
 * @return boolean

## 󠀁[acf_get_location_screen()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_screen)󠁿

Returns ann array of screen args to be used against matching rules.

 * @date 8/4/20
 * @since ACF 5.9.0
 * @param array $screen The screen args.
 * @param array $deprecated Deprecated.
 * @return array

## 󠀁[acf_register_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_register_location_rule)󠁿

Alias of acf_register_location_type().

 * @date 31/5/17
 * @since ACF 5.6.0
 * @param string $class_name The location class name.
 * @return (ACF_Location|false)

## 󠀁[acf_get_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_location_rule)󠁿

Alias of acf_get_location_type().

 * @date 31/5/17
 * @since ACF 5.6.0
 * @param string $class_name The location class name.
 * @return (ACF_Location|false)

## 󠀁[acf_get_valid_location_rule()](https://developer.wordpress.org/secure-custom-fields/code-reference/locations-file/?output_format=md#acf_get_valid_location_rule)󠁿

Alias of acf_validate_location_rule().

 * @date 30/5/17
 * @since ACF 5.6.0
 * @param array $rule The location rule.
 * @return array

---

First published

February 21, 2025

Last updated

June 23, 2025

Edit article

[ Improve it on GitHub: Locations Global Functions ](https://github.com/wordpress/secure-custom-fields/edit/trunk/docs/code-reference/locations-file.md)

Changelog

[ See list of changes: Locations Global Functions ](https://github.com/wordpress/secure-custom-fields/commits/trunk/docs/code-reference/locations-file.md)

[  Previous: Local Meta Global Functions](https://developer.wordpress.org/secure-custom-fields/code-reference/local-meta-file/)

[  Next: Loop Global Functions](https://developer.wordpress.org/secure-custom-fields/code-reference/loop-file/)