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

جميع خطاطيف متفرقات البالغ عددها 30 →