<html lang="ja-jp" dir="ltr"><head></head><body>### [wpforms_field_select_choicesjs_config](https://wpforms.com/developers/wpforms_field_select_choicesjs_config/)

**公開日:** 2021年2月16日
**著者:** Editorial Team

**抜粋:** wpforms_field_select_choicesjs_config フィルターは、モダンなドロップダウンフォームフィールドのデフォルト設定を変更する機能を提供するために使用されます。

**コンテンツ:**

## 説明

`wpforms_field_select_choicesjs_config` フィルターは、**モダンなドロップダウン**フォームフィールドのデフォルト設定を変更する機能を提供するために使用されます。

## パラメータ

$config*(array)* ドロップダウンで使用されるデフォルト設定の配列。
$forms*(int)* フォームID。
## ソース

`wpforms/includes/fields/class-base.php`

## 詳細情報

このフィルターには、**読み込み中**、「結果が見つかりません」、「アイテムを選択」などのデフォルト設定があります。テキスト値とそのキー名の完全なリストを以下に示します。

`'loadingText'       =&gt; esc_html__( '読み込み中...', 'wpforms-lite' ),'noResultsText'     =&gt; esc_html__( '結果が見つかりません。', 'wpforms-lite' ),'noChoicesText'     =&gt; esc_html__( '選択できる選択肢がありません。', 'wpforms-lite' ),'itemSelectText'    =&gt; esc_attr__( '選択するには押してください。', 'wpforms-lite' ),'uniqueItemText'    =&gt; esc_html__( '一意の値のみ追加できます。', 'wpforms-lite' ),'customAddItemText' =&gt; esc_html__( '特定の条件に一致する値のみ追加できます。', 'wpforms-lite' ),`

## 例

```

/**
 * モダンなドロップダウンフォームフィールドの設定テキスト。
 *
 * @link   https://wpforms.com/developers/wpforms_field_select_choicesjs_config/
 *
 * @param  array $config
 * @param  int   $forms
 * @return array
 */

function wpf_dev_change_modern_dropdown_noresults_text( $config, $forms ) {
      
    // 519を実際のフォームIDに変更するか、この条件を削除してすべてのフォームに適用します。
    if ( ! array_key_exists( 519, $forms ) ) {
        return $config;
    }
      
        // 同じページに複数のフォームがある場合、カスタマイズはすべてに適用されます。
        $config[ 'loadingText' ]       = __( '検索中....', 'your-text-domain' );
		$config[ 'noResultsText' ]     = __( '何も見つかりませんでした', 'your-text-domain' );
		$config[ 'noChoicesText' ]     = __( '探している選択肢ではありません', 'your-text-domain' );
		$config[ 'itemSelectText' ]    = __( '私を選択してください', 'your-text-domain' );
		$config[ 'uniqueItemText' ]    = __( '一意の値のみ追加できます。', 'your-text-domain' );
		$config[ 'customAddItemText' ] = __( '特定の条件に一致する値のみ追加できます。', 'your-text-domain' );
		$config[ 'searchResultLimit' ] = 2;
  
    return $config;
}
  
add_filter( 'wpforms_field_select_choicesjs_config', 'wpf_dev_change_modern_dropdown_noresults_text', 10, 2 );

```

## 参照記事

- [モダンなドロップダウンフィールドで「結果が見つかりません」テキストを変更する方法](https://wpforms.com/developers/how-to-change-the-no-results-found-text-in-the-modern-dropdown-field/ "モダンなドロップダウンフィールドで「結果が見つかりません」テキストを変更する方法")
- [モダンなドロップダウンフィールドをカスタマイズする方法](https://wpforms.com/developers/how-to-customize-the-modern-dropdown-field/ "モダンなドロップダウンフィールドをカスタマイズする方法")

**カテゴリー:** フィルターフック

**タグ:** PHP

---</body></html>