• サイトデザイン工事中です。ご意見をお寄せください
  • 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

テンプレートタグ/wp dropdown users

提供:WordPress Codex 日本語版
移動: 案内, 検索

このページ「テンプレートタグ/wp dropdown users」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

情報募集中 このテンプレートタグの説明やコードの書き方、活用例参考になるページがあったら、他のWordPressユーザのためにどんどん書き込みましょう! 該当部分を編集するか、このページのノートまたはフォーラム等で教えてください。

目次

説明

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


個人用ツール
名前空間
変種
操作
このサイトについて
特集
サーバ別情報
リファレンス
ドキュメント整備
ツールボックス
他の言語