• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

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

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

提供: WordPress Codex 日本語版
< テンプレートタグ
2010年3月3日 (水) 21:20時点におけるBono (トーク | 投稿記録)による版 (en:Template Tags/wp dropdown users 13:44, 4 August 2009 Benoithubert 版を翻訳用にコピー)

(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Description

Create dropdown HTML content of users.

Usage

%%% <?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' => ); ?> %%%

Parameters

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.

Examples

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>

Change Log

Since: 2.3.0

Source File

wp_dropdown_users() is located in wp-includes/user.php.

最新英語版: WordPress Codex » Template Tags/wp_dropdown_users最新版との差分

Related

リスト・ドロップダウン関数: 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()


関数リファレンステンプレートタグ目次もご覧ください。