acf_render_bidirectional_field_settings()
Renders the field settings required for bidirectional fields
Хуков нет.
Возвращает
null. Ничего (null).
Использование
acf_render_bidirectional_field_settings( $field );
- $field(массив) (обязательный)
- The field object passed into field setting functions.
Список изменений
| С версии 6.2 | Введена. |
Код acf_render_bidirectional_field_settings() acf render bidirectional field settings ACF 6.4.2
function acf_render_bidirectional_field_settings( $field ) {
if ( ! acf_get_setting( 'enable_bidirection' ) ) {
return;
}
acf_render_field_setting(
$field,
array(
'label' => __( 'Bidirectional', 'acf' ),
'instructions' => __( 'Update a field on the selected values, referencing back to this ID', 'acf' ),
'type' => 'true_false',
'name' => 'bidirectional',
'ui' => 1,
)
);
acf_render_field_setting(
$field,
array(
'name' => 'bidirectional_notes',
'type' => 'message',
'message' => acf_get_bidirectional_field_settings_instruction_text(),
'conditions' => array(
'field' => 'bidirectional',
'operator' => '==',
'value' => 1,
),
)
);
acf_render_field_setting(
$field,
array(
'type' => 'select',
'name' => 'bidirectional_target',
'label' => __( 'Target Field', 'acf' ),
'instructions' => __( 'Select field(s) to store the reference back to the item being updated. You may select this field. Target fields must be compatible with where this field is being displayed. For example, if this field is displayed on a Taxonomy, your target field should be of type Taxonomy', 'acf' ),
'class' => 'bidrectional_target',
'choices' => acf_build_bidirectional_target_current_choices( $field['bidirectional_target'] ),
'conditions' => array(
'field' => 'bidirectional',
'operator' => '==',
'value' => 1,
),
'ui' => 1,
'multiple' => 1,
'ajax' => 1,
)
);
}