本文整理汇总了PHP中get_linkobjects函数的典型用法代码示例。如果您正苦于以下问题:PHP get_linkobjects函数的具体用法?PHP get_linkobjects怎么用?PHP get_linkobjects使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_linkobjects函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_linkobjectsbyname
/**
* Gets an array of link objects associated with category $cat_name.
*
* <code>
* $links = get_linkobjectsbyname('fred');
* foreach ($links as $link) {
* echo '<li>'.$link->link_name.'</li>';
* }
* </code>
*
* @since 1.0.1
* @deprecated 2.1
* @deprecated Use get_bookmarks()
* @see get_bookmarks()
*
* @param string $cat_name The category name to use. If no match is found uses all.
* @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'.
* Or maybe owner. If you start the name with an underscore the order will be reversed. You can also
* specify 'rand' as the order which will return links in a random order.
* @param int $limit Limit to X entries. If not specified, all entries are shown.
* @return unknown
*/
function get_linkobjectsbyname($cat_name = "noname", $orderby = 'name', $limit = -1)
{
_deprecated_function(__FUNCTION__, '2.1', 'get_bookmarks()');
$cat_id = -1;
$cat = get_term_by('name', $cat_name, 'link_category');
if ($cat) {
$cat_id = $cat->term_id;
}
return get_linkobjects($cat_id, $orderby, $limit);
}
开发者ID:rkglug,项目名称:WordPress,代码行数:32,代码来源:deprecated.php
示例2: get_linkobjectsbyname
/** function get_linkobjectsbyname()
** Gets an array of link objects associated with category 'cat_name'.
** Parameters:
** cat_name (default 'noname') - The category name to use. If no
** match is found uses all
** orderby (default 'id') - the order to output the links. E.g. 'id', 'name',
** 'url', 'description', or 'rating'. Or maybe owner. If you start the
** name with an underscore the order will be reversed.
** You can also specify 'rand' as the order which will return links in a
** random order.
** limit (default -1) - Limit to X entries. If not specified, all entries
** are shown.
**
** Use this like:
** $links = get_linkobjectsbyname('fred');
** foreach ($links as $link) {
** echo '<li>'.$link->link_name.'</li>';
** }
**/
function get_linkobjectsbyname($cat_name = "noname", $orderby = 'name', $limit = -1)
{
global $wpdb;
$cat_id = -1;
$results = $wpdb->get_results("SELECT cat_id FROM {$wpdb->linkcategories} WHERE cat_name='{$cat_name}'");
if ($results) {
foreach ($results as $result) {
$cat_id = $result->cat_id;
}
}
return get_linkobjects($cat_id, $orderby, $limit);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:links.php
示例3: get_linkobjectsbyname
/** function get_linkobjectsbyname()
** Gets an array of link objects associated with category 'cat_name'.
** Parameters:
** cat_name (default 'noname') - The category name to use. If no
** match is found uses all
** orderby (default 'id') - the order to output the links. E.g. 'id', 'name',
** 'url', 'description', or 'rating'. Or maybe owner. If you start the
** name with an underscore the order will be reversed.
** You can also specify 'rand' as the order which will return links in a
** random order.
** limit (default -1) - Limit to X entries. If not specified, all entries
** are shown.
**
** Use this like:
** $links = get_linkobjectsbyname('fred');
** foreach ($links as $link) {
** echo '<li>'.stripslashes($link->link_name).'</li>';
** }
**/
function get_linkobjectsbyname($cat_name = "noname", $orderby = 'name', $limit = -1)
{
$cat_id = -1;
$results = $GLOBALS['wpdb']->get_results("SELECT cat_id FROM " . wp_table('linkcategories') . " WHERE cat_name='{$cat_name}'");
if ($results) {
foreach ($results as $result) {
$cat_id = $result->cat_id;
}
}
return get_linkobjects($cat_id, $orderby, $limit);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:30,代码来源:links.php
示例4: get_linkobjectsbyname
/** function get_linkobjectsbyname()
** Gets an array of link objects associated with category 'cat_name'.
** Parameters:
** cat_name (default 'noname') - The category name to use. If no
** match is found uses all
** orderby (default 'id') - the order to output the links. E.g. 'id', 'name',
** 'url', 'description', or 'rating'. Or maybe owner. If you start the
** name with an underscore the order will be reversed.
** You can also specify 'rand' as the order which will return links in a
** random order.
** limit (default -1) - Limit to X entries. If not specified, all entries
** are shown.
**
** Use this like:
** $links = get_linkobjectsbyname('fred');
** foreach ($links as $link) {
** echo '<li>'.$link->link_name.'</li>';
** }
**/
function get_linkobjectsbyname($cat_name = "noname", $orderby = 'name', $limit = -1)
{
global $wpdb;
$cat_id = -1;
$cat = get_term_by('name', $cat_name, 'link_category');
if ($cat) {
$cat_id = $cat->term_id;
}
return get_linkobjects($cat_id, $orderby, $limit);
}
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:29,代码来源:deprecated.php
示例5: syndicated_links
function syndicated_links()
{
$contributors = FeedWordPress::link_category_id();
if (function_exists('get_bookmarks')) {
$links = get_bookmarks(array("category" => $contributors));
} else {
$links = get_linkobjects($contributors);
// deprecated as of WP 2.1
}
return $links;
}
开发者ID:jcbozonier,项目名称:master,代码行数:11,代码来源:feedwordpress.php
注:本文中的get_linkobjects函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论