WPML
wpml_forms_config_wpforms
Typ
filter
Kategorie
Sonstiges
WPML-Version
4.9.2

Beschreibung

Verwenden Sie diesen Filter, wenn Sie die Inhalte der Konfiguration in wpml-forms-config.xml updatesicher ändern müssen oder wenn Sie ein Plugin/Theme entwickeln, das dies erfordert.

$config wird auf Basis von wpml-forms-config.xml erstellt und kann eine komplexe Struktur aufweisen. Daher ist es am besten, Änderungen zunächst in wpml-forms-config.xml vorzunehmen, sie in der Vorschau zu betrachten und die Array-Struktur für die gewünschte Änderung zu rekonstruieren – siehe das Beispiel zur Hook-Verwendung.

Hinweis: Dieser Filter ist in WPForms ML 0.5.0 und höher verfügbar.

Argumente

apply_filters( “wpml_forms_config_wpforms”, array $config );

$config
– (array)(Erforderlich) Die in wpml-forms-config.xml für dieses Plugin definierte Konfiguration, konvertiert in ein Array-Format.

Anwendungsbeispiel

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

Alle 30 Sonstiges-Hooks →