| CARVIEW |
acf/load_field
Documentation Filters acf/load_field
Description
Filters the $field settings array after being loaded.
A field is loaded anytime it is displayed, or its value is loaded. This filter applies to both fields saved in the database and also those registered locally via PHP or JSON.
Changelog
- Added in version 4.0.0
Parameters
apply_filters( 'acf/load_field', $field );
$field(array) The field array containing all settings.
Modifers
This filter provides modifiers to target specific fields. The following filter names are available:
acf/load_fieldApplies to all fields.acf/load_field/type={$type}Applies to all fields of a specific type.acf/load_field/name={$name}Applies to all fields of a specific name.acf/load_field/key={$key}Applies to all fields of a specific key.
Example
This example demonstrates how to modify a specific field’s settings.
functions.php
<?php
function my_acf_load_field( $field ) {
$field['required'] = true;
$field['choices'] = array(
'custom' => 'My Custom Choice',
'custom_2' => 'My Custom Choice 2'
);
return $field;
}
// Apply to all fields.
// add_filter('acf/load_field', 'my_acf_load_field');
// Apply to select fields.
// add_filter('acf/load_field/type=select', 'my_acf_load_field');
// Apply to fields named "custom_select".
add_filter('acf/load_field/name=custom_select', 'my_acf_load_field');
// Apply to field with key "field_123abcf".
// add_filter('acf/load_field/key=field_123abcf', 'my_acf_load_field');
Supercharge Your Website With Premium Features Using ACF PRO
Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.
Related
- Filters: acf/load_value
- Filters: acf/prepare_field
- Filters: acf/update_field
- Filters: acf/format_value
- Filters: acf/update_value
On this page
In this category
- acf/admin/license_key_constant_message
- acf/ajax/shortcode_capability
- acf/blocks/default_block_version
- acf/blocks/fields_needing_wide_popover
- acf/blocks/fields_to_open_in_expanded_editor
- acf/blocks/top_toolbar_fields
- acf/compatibility
- acf/field_group/auto_add_first_field
- acf/field_group/disable_field_settings_tabs
- acf/field_group/enable_field_browser
- acf/fields/flexible_content/layout_title
- acf/fields/google_map/api
- acf/fields/post_object/query
- acf/fields/post_object/result
- acf/fields/relationship/query
- acf/fields/relationship/result
- acf/fields/taxonomy/query
- acf/fields/taxonomy/result
- acf/fields/taxonomy/wp_list_categories
- acf/fields/user/query
- acf/fields/user/result
- acf/format_value
- acf/json/eof_newline
- acf/json/save_file_name
- acf/load_field
- acf/load_value
- acf/options_page/settings
- acf/pre_save_post
- acf/prepare_field
- acf/register_block_type_args
- acf/settings
- acf/settings/enable_options_pages_ui
- acf/settings/enable_post_types
- acf/shortcode/prevent_access
- acf/update_field
- acf/update_value
- acf/upload_prefilter
- acf/validate_attachment
- acf/validate_value
Supercharge Your Website With Premium Features Using ACF PRO
Do more, build bigger, and extend further with features that unlock all the potential of WordPress.
Explore FeaturesSign up for the latest Advanced Custom Fields news, updates, and developer tutorials
Build smarter, faster, better with ACF®
Community
© 2025 WPEngine, Inc. All rights reserved.
1WP Engine is a proud member and supporter of the community of WordPress® users. The WordPress® trademarks are the intellectual property of the WordPress Foundation, and the Woo® and WooCommerce® trademarks are the intellectual property of WooCommerce, Inc. Uses of the WordPress®, Woo®, and WooCommerce® names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation or WooCommerce, Inc. WP Engine is not endorsed or owned by, or affiliated with, the WordPress Foundation or WooCommerce, Inc.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.