WPML
wpml_forms_config_wpforms
유형
filter
카테고리
기타
WPML 버전
4.9.2

설명

업데이트해도 안전한 방식으로 wpml-forms-config.xml의 구성 내용을 수정해야 하거나, 이를 필요로 하는 플러그인/테마를 개발할 때 이 필터를 사용하세요.

$config은(는) wpml-forms-config.xml을(를) 기반으로 생성되며 복잡한 구조를 가질 수 있습니다. 따라서 먼저 wpml-forms-config.xml에서 변경 사항을 적용하고 미리 확인한 다음, 원하는 수정 사항에 맞게 배열 구조를 재구성하는 것이 가장 좋습니다. 훅 사용법의 예시를 참조하세요.

참고: 이 필터는 WPForms ML 0.5.0 이상에서 사용할 수 있습니다.

인수

apply_filters( “wpml_forms_config_wpforms”, array $config );

$config
– (array)(필수) 이 플러그인을 위해 wpml-forms-config.xml에 정의된 구성을 배열 형식으로 변환한 것입니다.

사용 예시

add_filter( 'wpml_forms_config_wpforms', function ( array $config ): array {
    $config['field']['my-custom-field'] = [
        'type'       => 'ARRAY',
        'properties' => 'f_label'
    ];
    return $config;
} );

/**
 * Developer Example
 *
 * How to persist the change in the simplest way:
 * 1. Modify the `wpml-forms-config.xml` file as needed to achieve the desired effect.
 * 2. Run the filter and execute `var_export( $config );`
 *    - then locate the modified elements and apply them manually to `$config`.
 *    - After that, you can restore the original `wpml-forms-config.xml` file
 *    - verify that everything behaves correctly.
 */
add_filter( 'wpml_forms_config_wpforms', function ( array $config ): array {
    // add modifications here
    var_export( $config );
    return $config;
} );

icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_tf_feedback_open_link, wpml_translatable_user_meta_fields

모든 기타 훅 30개 →