- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
テンプレートタグ/wp dropdown users
このページ「テンプレートタグ/wp dropdown users」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
タグ一覧: テンプレートタグ | インクルードタグ | 条件分岐タグ | その他の関数 | Code Reference
使い方: テンプレートタグ入門 | パラメータの渡し方 | 初心者の方へ | その他のテーマ関連資料
説明
Create dropdown HTML content of users.
使い方
%%% <?php wp_dropdown_users( $args ); ?> %%%
Default Usage
%%% <?php $args = array( 'show_option_all' => , 'show_option_none' => , 'orderby' => 'display_name', 'order' => 'ASC', 'include' => , 'exclude' => , 'multi' => 0, 'show' => 'display_name', 'echo' => 1, 'selected' => 0, 'name' => 'user', 'class' => ); ?> %%%
パラメータ
- show_option_all
- (string) Causes the HTML for the dropdown to allow you to select All of the users.
- show_option_none
- (string) Causes the HTML for the dropdown to allow you to select NONE of the users.
- orderby
- (string) Key to sort options by. Valid values:
- 'ID'
- 'user_nicename'
- 'display_name' - Default
- order
- (string) Sort order for options. Valid values:
- 'ASC' - Default
- 'DESC'
- include
- (string) Comma separated list of users IDs to include. For example, 'include=4,12' means users IDs 4 and 12 will be displayed/echoed or returned. Defaults to exclude all.
- exclude
- (string) Comma separated list of users IDs to exclude. For example, 'exclude=4,12' means users IDs 4 and 12 will NOT be displayed/echoed or returned. Defaults to exclude nothing.
- multi
- (boolean) Whether to skip the ID attribute on the 'select' element.
- 1 (True)
- 0 (False) - Default
- show
- (string) User table column to display. If the selected item is empty then the user_login will be displayed in parentesis.
- 'ID'
- 'user_login'
- 'display_name' - Default
- echo
- (boolean) Display bookmarks (TRUE) or return them for use by PHP (FALSE).
- 1 (True) - Default
- 0 (False)
- selected
- (integer) User ID of the user to be 'selected' or presented in the display box. Defaults to no user selected.
- name
- (string) Name assigned to the dropdown form. Defaults to 'user'.
- class
- (string) Class assinged to the dropdown form.
用例
Dropdown with Submit Button
Displays a users dropdown list in HTML form with a submit button.
<li id="users"> <h2><?php _e('users:'); ?></h2> <form action="<?php bloginfo('url'); ?>" method="get"> <?php wp_dropdown_users(); ?> <input type="submit" name="submit" value="view" /> </form> </li>
変更履歴
Since: 2.3.0
ソースファイル
wp_dropdown_users() is located in wp-includes/user.php
.
最新英語版: WordPress Codex » Template Tags/wp_dropdown_users (最新版との差分)
関連
リスト・ドロップダウン関数: wp_list_authors(), wp_list_categories(), wp_list_pages(), wp_list_bookmarks(), wp_list_comments(), wp_get_archives(), wp_page_menu(), wp_dropdown_pages(), wp_dropdown_categories(), wp_dropdown_users()