Add query string style API support to wp_get_linksbyname(). http://mosquito.wordpress.org/view.php?id=1191
git-svn-id: https://develop.svn.wordpress.org/trunk@2507 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
db62c48897
commit
01d17183e2
|
@ -48,13 +48,18 @@ function bool_from_yn($yn) {
|
|||
** Parameters:
|
||||
** category (no default) - The category to use.
|
||||
**/
|
||||
function wp_get_linksbyname($category) {
|
||||
function wp_get_linksbyname($category, $args = '') {
|
||||
global $wpdb;
|
||||
|
||||
$cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
|
||||
. " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
|
||||
. " text_after_all, list_limit FROM $wpdb->linkcategories WHERE cat_name='$category'");
|
||||
if ($cat) {
|
||||
|
||||
if (! $cat) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($args)) {
|
||||
if ($cat->sort_desc == 'Y') {
|
||||
$cat->sort_order = '_'.$cat->sort_order;
|
||||
}
|
||||
|
@ -62,6 +67,9 @@ function wp_get_linksbyname($category) {
|
|||
$cat->text_after_link, bool_from_yn($cat->show_images), $cat->sort_order,
|
||||
bool_from_yn($cat->show_description), bool_from_yn($cat->show_rating),
|
||||
$cat->list_limit, bool_from_yn($cat->show_updated));
|
||||
} else {
|
||||
$args = add_query_arg('category', $cat->cat_id, $args);
|
||||
wp_get_links($args);
|
||||
}
|
||||
} // end wp_get_linksbyname
|
||||
|
||||
|
|
Loading…
Reference in New Issue