wpml_forms_config_ninja-forms
- タイプ
- filter
- カテゴリー
- その他
- WPMLバージョン
- 4.9.2
説明
アップデートの影響を受けずにwpml-forms-config.xmlの設定内容を変更する必要がある場合、またはこれを必要とするプラグインやテーマを開発している場合に、このフィルターを使用します。
$configはwpml-forms-config.xmlに基づいて作成され、複雑な構造を持つ可能性があるため、最初にwpml-forms-config.xmlで変更を行い、それをプレビューしてから、目的の変更に合わせて配列構造を再構築することをお勧めします。フックの使用例を参照してください。
注: このフィルターはNinja Forms ML 0.5.0以降で利用可能です。
引数
apply_filters( “wpml_forms_config_ninja-forms”, array $config );
$config
– (array)(必須) このプラグイン用にwpml-forms-config.xmlで定義され、配列形式に変換された設定。
使用例
add_filter( 'wpml_forms_config_ninja-forms', 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_ninja-forms', 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_wpforms, wpml_tf_feedback_open_link, wpml_translatable_user_meta_fields