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