wp_dropdown_users

Sponsored Link

ユーザーのHTMLコンテンツのドロップダウンを作成します。

Sponsored Link

原文(翻訳元)Create dropdown HTML content of users.

wp_dropdown_usersのテンプレートタグ使用方法

<?php wp_dropdown_users( $args ); ?> 

デフォルトの使い方

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

wp_dropdown_usersのパラメーター

show_option_all

(string)すべてのユーザを選択できるように、ドロップダウンにHTMLを引き起こします。

原文(翻訳元)(string) Causes the HTML for the dropdown to allow you to select All of the users.

show_option_none

(string)ユーザーのNONEを選択できるように、ドロップダウンにHTMLを引き起こします。

原文(翻訳元)(string) Causes the HTML for the dropdown to allow you to select NONE of the users.

orderby

(string)オプションを並べ替えるキーです。有効な値:

原文(翻訳元)(string) Key to sort options by. Valid values:

  • ‘ID’
  • ‘user_nicename’
  • ‘display_name’ – Default

order

(string)オプションの並べ替え順。有効な値:

原文(翻訳元)(string) Sort order for options. Valid values:

  • ‘ASC’ – Default
  • ‘DESC’

include

(string)ユーザーIDのカンマ区切りのリストに含めます。たとえば、’include=4,12’の意味は、ユーザーIDの4と12が、表示/エコーまたは返すでしょう。デフォルトはすべて除外されます。

原文(翻訳元)(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

カンマで区切られたユーザーIDのリストを除外します。たとえば、’exclude=4,12′の意味IDは、ユーザーID4と12は、表示/エコーか返しません。デフォルトは何も除外しません。

原文(翻訳元)(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)’select’要素をID属性をスキップするかどうか。

原文(翻訳元)(boolean) Whether to skip the ID attribute on the ‘select’ element.

  • 1 (True)
  • 0 (False) – Default

show

(string) Userテーブルの列が表示されます。選択した項目が空の場合、user_loginは括弧に表示されるでしょう。

原文(翻訳元)(string) User table column to display. If the selected item is empty then the user_login will be displayed in *parenthesis.

  • ‘ID’
  • ‘user_login’
  • ‘display_name’ – Default

echo

(boolean) ユーザー(TRUE)を表示します。また、PHP(FALSE)で使用するためにそれらを返します。

原文(翻訳元)(boolean) Display *user (TRUE) or return them for use by PHP (FALSE).

  • 1 (True) – Default
  • 0 (False)

selected

(integer)ユーザーのユーザーIDは表示ボックスに’選択’または提示されます。デフォルトは、ないユーザーを選択。

原文(翻訳元)(integer) User ID of the user to be ‘selected’ or presented in the display box. Defaults to no user selected.

name

(string) ドロップダウンフォームに割り当てられる名前です。デフォルトは’user’です。

原文(翻訳元)(string) Name assigned to the dropdown form. Defaults to ‘user’.

class

(string) ドロップダウンフォーム割り当てられるClassです。

原文(翻訳元)(string) Class assinged to the dropdown form.

送信ボタンと一緒にドロップダウンを表示する方法

送信ボタンを持つHTML形式でユーザーのドロップダウンリストを表示します。

原文(翻訳元)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()は内に位置しています。

原文(翻訳元)wp_dropdown_users() is located in wp-includes/user.php.

関連テンプレートタグ

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

Sponsored Link