get_bookmarks

Sponsored Link

get_bookmarksの関数は、管理画面>リンク>編集パネルで見られるブックマークの配列を返します。get_bookmarksのテンプレートタグは、ブックマーク情報のディレクトリーを取得する事ができるユーザーを許可します。

Sponsored Link

This function returns an array of bookmarks found in the Administration > Links > Edit panel. This Template Tag allows the user to retrieve the bookmark information directly.

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

<?php get_bookmarks( $args ); ?> 

デフォルトの使用方法

<?php $args = array(
'orderby'=> 'name', 
'order'  => 'ASC',
'limit'  => -1, 
'category'   => ,
'category_name'  => , 
'hide_invisible' => 1,
'show_updated'   => 0, 
'include'=> ,
'exclude'=> ,
'search' =>  ); ?> 

デフォルトでの使用方法を取得:

By default, the usage gets:

  • All bookmarks ordered by name, ascending
  • Bookmarks marked as hidden are not returned.
  • The link_updated_f field (the update time in the form of a timestamp) is not returned.

get_bookmarksのパラメーター

orderby

(string) Value to sort bookmarks on. Defaults to ‘name’ unless you pass the value of ” (empty), in which case it sets to ‘id’. Valid options:

  • ‘id’
  • ‘url’
  • ‘name’ – Default
  • ‘target’
  • ‘description’
  • ‘owner’ – User who added bookmark through bookmarks Manager.
  • ‘rating’
  • ‘updated’
  • ‘rel’ – bookmark relationship (XFN).
  • ‘notes’
  • ‘rss’
  • ‘length’ – The length of the bookmark name, shortest to longest.
  • ‘rand’ – Display bookmarks in random order.

order

(string) Sort order, ascending or descending for the orderby parameter. Valid values:

  • ASC – Default
  • DESC

limit

(integer) Maximum number of bookmarks to display. Defaults to -1 (all bookmarks).

category

(string) Comma separated list of bookmark category ID’s.

category_name

(string) Category name of a catgeory of bookmarks to retrieve. Overrides category parameter.

hide_invisible

(boolean) TRUE causes only bookmarks with link_visible set to ‘Y’ to be retrieved.

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

show_updated

(boolean) TRUE causes an extra column called “link_category_f” to be inserted into the results, which contains the same value as “link_updated”, but in a unix timestamp format. Handy for using PHP date functions on this data.

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

include

(string)

(string) Comma separated list of numeric bookmark IDs to include in the output. For example, ‘include=1,3,6’ means to return or echo bookmark IDs 1, 3, and 6. If the include string is used, the category, category_name, and exclude parameters are ignored. Defaults to (all Bookmarks).

exclude

(string) 数値ブックマークIDのコンマリストで区切られたリストを除外します。例えば、’exclude=4,12’は、ブックマークID4と12は、返さないあるいはエコーしない事を意味します。デフォルト(何かを除外する)

(string) Comma separated list of numeric bookmark IDs to exclude. For example, ‘exclude=4,12’ means that bookmark IDs 4 and 12 will NOT be returned or echoed. Defaults to (exclude nothing).

search

(string) link_url,link_name,link_descriptionは、検索文字列のように検索します。デフォルトに。

(string) Searches link_url, link_name or link_description like the search string. Defaults to .

-“関連サイト”のリンクカテゴリーを作成します。
-いくつかのリンクを作成する場合は、カテゴリーとして”関連サイト”を選択を確認します。

– Create a link category ” Related Sites ”
– Create a few links , make sure you choose ” Related Sites ” as the category

ページにリンクを取得するための次のコードを使用します。:

In your pages you may use the following code to retrieve the links:

<?php
$bm = get_bookmarks( array(
'orderby'=> 'name', 
'order'  => 'ASC',
'limit'  => -1, 
'category'   => null,
'category_name'  => '<h2>関連ファンクションタグ</h2> Sites', 
'hide_invisible' => 1,
'show_updated'   => 0, 
'include'=> null,
'exclude'=> null,
'search' => '.'));
  foreach ($bm as $bookmark){ 
echo "<a id='<h2>関連ファンクションタグ</h2>links' href='{$bookmark->link_url}' target=_blank>
  {$bookmark->link_name}
 </a><br /><br />\";
  }
?> 

変更ログ

Since: 2.1.0

ソースファイル

get_bookmarks()は以下のファイル内に位置しています。

get_bookmarks() is located in

  • wp-includes/bookmark.php (the latest stable version)
  • wp-includes/bookmark.php (the development version)

関連ファンクションタグ

get_bookmark, get_bookmark_field, get_bookmarks, wp_list_bookmarks

Sponsored Link