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
– (مصفوفة)(مطلوب) الإعدادات المحددة في 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