开发者 | doublesharp |
---|---|
更新时间 | 2015年8月19日 23:59 |
PHP版本: | 3.0 及以上 |
WordPress版本: | 4.3 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
post_type
and meta_key
, post_type
, or site wide, or a
single post by meta_key, as well as marking a field as read-only. Edit your fields in the ACF Field Group editor and update code using the ACE.js
IDE with autocomplete and syntax validation.
Features
/wp-content/plugins/
directory.Ensure that you have Advanced Custom Fields installed and that it is activated. Validated Field will appear as a new input type in the field group editor.
Global configurations for the Validated Field plugin can be found in the WordPress Admin under Custom Fields > Validated Field Settings
.
json_encode()
to support PHP 5.2.eval()
implementation as ACF5 handler.Autoclear
: Yes
or No
- determine if a value should be automatically cleared if it does not match the mask. The previous default was Yes
.Placeholder
: 'char or string` - use a different character or string as a placeholder to be displayed as the user is entering their input.acf_render_field_settings()
with action acf/render_field_settings/type=?
to support ACF 5.2.3+.$message
to be returned from PHP code instead of false
to fail validation.if ( !filter_var( $value, FILTER_VALIDATE_URL ) ) return 'You must use a valid URL.';
$value
is not a URL, otherwise the default validation return is true
.DIV
to properly append error message to the correct input field.$wpdb->esc_like()
as instance method for "globally unique" fields.like_escape()
function with $wpdb->esc_like()
.$inputs
variable is now available using and index of meta_key
and returning an array with the values "field", "value", and "prev_value".ace.js
libraries locally and upgrade to version 1.1.7.Ctrl+F
/Cmd+F
), Replace (Ctrl+Alt+F
/Cmd+Opt+F
), and Replace All (Ctrl+Alt+Shft+F
/Cmd+Opt+Shft+F
).fontawesome.css
CSS and fonts locally and upgrade to version 4.2.acf/fields/relationship/query_posts
(ACF4) or acf/fields/relationship/query
(ACF5).acf/validate_value
filter is used for better compatibility and performance.acf_form()
.Custom Fields > Validated Field Settings
.acf_form_head()
to enqueue an admin theme, defaults to on.$sub_field['read_only']
with $field['read_only']
for jQuery masking, props @johnny_br.error_log()
statement from v1.2.5.es_ES
translation.ACF_VF_DRAFTS
to false
.ACF_VF_DEBUG
is set to true
.$message
from field configuration to UI.ACF_VF_DEBUG
constant.error_log()
statement from v1.1.1.acf/load_value/type=
, acf/update_value/type=
, acf/format_value/type=
, acf/format_value_for_api/type=
, acf/load_field/type=
, acf/update_field/type=
.$sub_field
properties not saving (use acf/create_field_options
action).acf_vf/unique_statuses
.post_type
. Props @ikivanov.