WPML
wpml_forms_config_wpforms
タイプ
filter
カテゴリー
その他
WPMLバージョン
4.9.2

説明

wpml-forms-config.xmlの設定内容をアップデートの影響を受けないように変更する必要がある場合、またはこれを必要とするプラグインやテーマを開発している場合に、このフィルターを使用します。

$configwpml-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件) →