Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: deprecated.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Deprecated functions from past WordPress versions. You shouldn't use these
[2] Fix | Delete
* functions and look for the alternatives instead. The functions will be
[3] Fix | Delete
* removed in a later version.
[4] Fix | Delete
*
[5] Fix | Delete
* @package WordPress
[6] Fix | Delete
* @subpackage Deprecated
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
/*
[10] Fix | Delete
* Deprecated functions come here to die.
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Retrieves all post data for a given post.
[15] Fix | Delete
*
[16] Fix | Delete
* @since 0.71
[17] Fix | Delete
* @deprecated 1.5.1 Use get_post()
[18] Fix | Delete
* @see get_post()
[19] Fix | Delete
*
[20] Fix | Delete
* @param int $postid Post ID.
[21] Fix | Delete
* @return array Post data.
[22] Fix | Delete
*/
[23] Fix | Delete
function get_postdata($postid) {
[24] Fix | Delete
_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );
[25] Fix | Delete
[26] Fix | Delete
$post = get_post($postid);
[27] Fix | Delete
[28] Fix | Delete
$postdata = array (
[29] Fix | Delete
'ID' => $post->ID,
[30] Fix | Delete
'Author_ID' => $post->post_author,
[31] Fix | Delete
'Date' => $post->post_date,
[32] Fix | Delete
'Content' => $post->post_content,
[33] Fix | Delete
'Excerpt' => $post->post_excerpt,
[34] Fix | Delete
'Title' => $post->post_title,
[35] Fix | Delete
'Category' => $post->post_category,
[36] Fix | Delete
'post_status' => $post->post_status,
[37] Fix | Delete
'comment_status' => $post->comment_status,
[38] Fix | Delete
'ping_status' => $post->ping_status,
[39] Fix | Delete
'post_password' => $post->post_password,
[40] Fix | Delete
'to_ping' => $post->to_ping,
[41] Fix | Delete
'pinged' => $post->pinged,
[42] Fix | Delete
'post_type' => $post->post_type,
[43] Fix | Delete
'post_name' => $post->post_name
[44] Fix | Delete
);
[45] Fix | Delete
[46] Fix | Delete
return $postdata;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Sets up the WordPress Loop.
[51] Fix | Delete
*
[52] Fix | Delete
* Use The Loop instead.
[53] Fix | Delete
*
[54] Fix | Delete
* @link https://developer.wordpress.org/themes/basics/the-loop/
[55] Fix | Delete
*
[56] Fix | Delete
* @since 1.0.1
[57] Fix | Delete
* @deprecated 1.5.0
[58] Fix | Delete
*/
[59] Fix | Delete
function start_wp() {
[60] Fix | Delete
global $wp_query;
[61] Fix | Delete
[62] Fix | Delete
_deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') );
[63] Fix | Delete
[64] Fix | Delete
// Since the old style loop is being used, advance the query iterator here.
[65] Fix | Delete
$wp_query->next_post();
[66] Fix | Delete
[67] Fix | Delete
setup_postdata( get_post() );
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Returns or prints a category ID.
[72] Fix | Delete
*
[73] Fix | Delete
* @since 0.71
[74] Fix | Delete
* @deprecated 0.71 Use get_the_category()
[75] Fix | Delete
* @see get_the_category()
[76] Fix | Delete
*
[77] Fix | Delete
* @param bool $echo Optional. Whether to echo the output. Default true.
[78] Fix | Delete
* @return int Category ID.
[79] Fix | Delete
*/
[80] Fix | Delete
function the_category_ID($echo = true) {
[81] Fix | Delete
_deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' );
[82] Fix | Delete
[83] Fix | Delete
// Grab the first cat in the list.
[84] Fix | Delete
$categories = get_the_category();
[85] Fix | Delete
$cat = $categories[0]->term_id;
[86] Fix | Delete
[87] Fix | Delete
if ( $echo )
[88] Fix | Delete
echo $cat;
[89] Fix | Delete
[90] Fix | Delete
return $cat;
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Prints a category with optional text before and after.
[95] Fix | Delete
*
[96] Fix | Delete
* @since 0.71
[97] Fix | Delete
* @deprecated 0.71 Use get_the_category_by_ID()
[98] Fix | Delete
* @see get_the_category_by_ID()
[99] Fix | Delete
*
[100] Fix | Delete
* @param string $before Optional. Text to display before the category. Default empty.
[101] Fix | Delete
* @param string $after Optional. Text to display after the category. Default empty.
[102] Fix | Delete
*/
[103] Fix | Delete
function the_category_head( $before = '', $after = '' ) {
[104] Fix | Delete
global $currentcat, $previouscat;
[105] Fix | Delete
[106] Fix | Delete
_deprecated_function( __FUNCTION__, '0.71', 'get_the_category_by_ID()' );
[107] Fix | Delete
[108] Fix | Delete
// Grab the first cat in the list.
[109] Fix | Delete
$categories = get_the_category();
[110] Fix | Delete
$currentcat = $categories[0]->category_id;
[111] Fix | Delete
if ( $currentcat != $previouscat ) {
[112] Fix | Delete
echo $before;
[113] Fix | Delete
echo get_the_category_by_ID($currentcat);
[114] Fix | Delete
echo $after;
[115] Fix | Delete
$previouscat = $currentcat;
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
/**
[120] Fix | Delete
* Prints a link to the previous post.
[121] Fix | Delete
*
[122] Fix | Delete
* @since 1.5.0
[123] Fix | Delete
* @deprecated 2.0.0 Use previous_post_link()
[124] Fix | Delete
* @see previous_post_link()
[125] Fix | Delete
*
[126] Fix | Delete
* @param string $format
[127] Fix | Delete
* @param string $previous
[128] Fix | Delete
* @param string $title
[129] Fix | Delete
* @param string $in_same_cat
[130] Fix | Delete
* @param int $limitprev
[131] Fix | Delete
* @param string $excluded_categories
[132] Fix | Delete
*/
[133] Fix | Delete
function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
[134] Fix | Delete
[135] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'previous_post_link()' );
[136] Fix | Delete
[137] Fix | Delete
if ( empty($in_same_cat) || 'no' == $in_same_cat )
[138] Fix | Delete
$in_same_cat = false;
[139] Fix | Delete
else
[140] Fix | Delete
$in_same_cat = true;
[141] Fix | Delete
[142] Fix | Delete
$post = get_previous_post($in_same_cat, $excluded_categories);
[143] Fix | Delete
[144] Fix | Delete
if ( !$post )
[145] Fix | Delete
return;
[146] Fix | Delete
[147] Fix | Delete
$string = '<a href="'.get_permalink($post->ID).'">'.$previous;
[148] Fix | Delete
if ( 'yes' == $title )
[149] Fix | Delete
$string .= apply_filters('the_title', $post->post_title, $post->ID);
[150] Fix | Delete
$string .= '</a>';
[151] Fix | Delete
$format = str_replace('%', $string, $format);
[152] Fix | Delete
echo $format;
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* Prints link to the next post.
[157] Fix | Delete
*
[158] Fix | Delete
* @since 0.71
[159] Fix | Delete
* @deprecated 2.0.0 Use next_post_link()
[160] Fix | Delete
* @see next_post_link()
[161] Fix | Delete
*
[162] Fix | Delete
* @param string $format
[163] Fix | Delete
* @param string $next
[164] Fix | Delete
* @param string $title
[165] Fix | Delete
* @param string $in_same_cat
[166] Fix | Delete
* @param int $limitnext
[167] Fix | Delete
* @param string $excluded_categories
[168] Fix | Delete
*/
[169] Fix | Delete
function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
[170] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'next_post_link()' );
[171] Fix | Delete
[172] Fix | Delete
if ( empty($in_same_cat) || 'no' == $in_same_cat )
[173] Fix | Delete
$in_same_cat = false;
[174] Fix | Delete
else
[175] Fix | Delete
$in_same_cat = true;
[176] Fix | Delete
[177] Fix | Delete
$post = get_next_post($in_same_cat, $excluded_categories);
[178] Fix | Delete
[179] Fix | Delete
if ( !$post )
[180] Fix | Delete
return;
[181] Fix | Delete
[182] Fix | Delete
$string = '<a href="'.get_permalink($post->ID).'">'.$next;
[183] Fix | Delete
if ( 'yes' == $title )
[184] Fix | Delete
$string .= apply_filters('the_title', $post->post_title, $post->ID);
[185] Fix | Delete
$string .= '</a>';
[186] Fix | Delete
$format = str_replace('%', $string, $format);
[187] Fix | Delete
echo $format;
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
/**
[191] Fix | Delete
* Whether user can create a post.
[192] Fix | Delete
*
[193] Fix | Delete
* @since 1.5.0
[194] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[195] Fix | Delete
* @see current_user_can()
[196] Fix | Delete
*
[197] Fix | Delete
* @param int $user_id
[198] Fix | Delete
* @param int $blog_id Not Used
[199] Fix | Delete
* @param int $category_id Not Used
[200] Fix | Delete
* @return bool
[201] Fix | Delete
*/
[202] Fix | Delete
function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
[203] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[204] Fix | Delete
[205] Fix | Delete
$author_data = get_userdata($user_id);
[206] Fix | Delete
return ($author_data->user_level > 1);
[207] Fix | Delete
}
[208] Fix | Delete
[209] Fix | Delete
/**
[210] Fix | Delete
* Whether user can create a post.
[211] Fix | Delete
*
[212] Fix | Delete
* @since 1.5.0
[213] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[214] Fix | Delete
* @see current_user_can()
[215] Fix | Delete
*
[216] Fix | Delete
* @param int $user_id
[217] Fix | Delete
* @param int $blog_id Not Used
[218] Fix | Delete
* @param int $category_id Not Used
[219] Fix | Delete
* @return bool
[220] Fix | Delete
*/
[221] Fix | Delete
function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
[222] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[223] Fix | Delete
[224] Fix | Delete
$author_data = get_userdata($user_id);
[225] Fix | Delete
return ($author_data->user_level >= 1);
[226] Fix | Delete
}
[227] Fix | Delete
[228] Fix | Delete
/**
[229] Fix | Delete
* Whether user can edit a post.
[230] Fix | Delete
*
[231] Fix | Delete
* @since 1.5.0
[232] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[233] Fix | Delete
* @see current_user_can()
[234] Fix | Delete
*
[235] Fix | Delete
* @param int $user_id
[236] Fix | Delete
* @param int $post_id
[237] Fix | Delete
* @param int $blog_id Not Used
[238] Fix | Delete
* @return bool
[239] Fix | Delete
*/
[240] Fix | Delete
function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
[241] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[242] Fix | Delete
[243] Fix | Delete
$author_data = get_userdata($user_id);
[244] Fix | Delete
$post = get_post($post_id);
[245] Fix | Delete
$post_author_data = get_userdata($post->post_author);
[246] Fix | Delete
[247] Fix | Delete
if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))
[248] Fix | Delete
|| ($author_data->user_level > $post_author_data->user_level)
[249] Fix | Delete
|| ($author_data->user_level >= 10) ) {
[250] Fix | Delete
return true;
[251] Fix | Delete
} else {
[252] Fix | Delete
return false;
[253] Fix | Delete
}
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
/**
[257] Fix | Delete
* Whether user can delete a post.
[258] Fix | Delete
*
[259] Fix | Delete
* @since 1.5.0
[260] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[261] Fix | Delete
* @see current_user_can()
[262] Fix | Delete
*
[263] Fix | Delete
* @param int $user_id
[264] Fix | Delete
* @param int $post_id
[265] Fix | Delete
* @param int $blog_id Not Used
[266] Fix | Delete
* @return bool
[267] Fix | Delete
*/
[268] Fix | Delete
function user_can_delete_post($user_id, $post_id, $blog_id = 1) {
[269] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[270] Fix | Delete
[271] Fix | Delete
// Right now if one can edit, one can delete.
[272] Fix | Delete
return user_can_edit_post($user_id, $post_id, $blog_id);
[273] Fix | Delete
}
[274] Fix | Delete
[275] Fix | Delete
/**
[276] Fix | Delete
* Whether user can set new posts' dates.
[277] Fix | Delete
*
[278] Fix | Delete
* @since 1.5.0
[279] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[280] Fix | Delete
* @see current_user_can()
[281] Fix | Delete
*
[282] Fix | Delete
* @param int $user_id
[283] Fix | Delete
* @param int $blog_id Not Used
[284] Fix | Delete
* @param int $category_id Not Used
[285] Fix | Delete
* @return bool
[286] Fix | Delete
*/
[287] Fix | Delete
function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {
[288] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[289] Fix | Delete
[290] Fix | Delete
$author_data = get_userdata($user_id);
[291] Fix | Delete
return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
/**
[295] Fix | Delete
* Whether user can delete a post.
[296] Fix | Delete
*
[297] Fix | Delete
* @since 1.5.0
[298] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[299] Fix | Delete
* @see current_user_can()
[300] Fix | Delete
*
[301] Fix | Delete
* @param int $user_id
[302] Fix | Delete
* @param int $post_id
[303] Fix | Delete
* @param int $blog_id Not Used
[304] Fix | Delete
* @return bool returns true if $user_id can edit $post_id's date
[305] Fix | Delete
*/
[306] Fix | Delete
function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {
[307] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[308] Fix | Delete
[309] Fix | Delete
$author_data = get_userdata($user_id);
[310] Fix | Delete
return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
/**
[314] Fix | Delete
* Whether user can delete a post.
[315] Fix | Delete
*
[316] Fix | Delete
* @since 1.5.0
[317] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[318] Fix | Delete
* @see current_user_can()
[319] Fix | Delete
*
[320] Fix | Delete
* @param int $user_id
[321] Fix | Delete
* @param int $post_id
[322] Fix | Delete
* @param int $blog_id Not Used
[323] Fix | Delete
* @return bool returns true if $user_id can edit $post_id's comments
[324] Fix | Delete
*/
[325] Fix | Delete
function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {
[326] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[327] Fix | Delete
[328] Fix | Delete
// Right now if one can edit a post, one can edit comments made on it.
[329] Fix | Delete
return user_can_edit_post($user_id, $post_id, $blog_id);
[330] Fix | Delete
}
[331] Fix | Delete
[332] Fix | Delete
/**
[333] Fix | Delete
* Whether user can delete a post.
[334] Fix | Delete
*
[335] Fix | Delete
* @since 1.5.0
[336] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[337] Fix | Delete
* @see current_user_can()
[338] Fix | Delete
*
[339] Fix | Delete
* @param int $user_id
[340] Fix | Delete
* @param int $post_id
[341] Fix | Delete
* @param int $blog_id Not Used
[342] Fix | Delete
* @return bool returns true if $user_id can delete $post_id's comments
[343] Fix | Delete
*/
[344] Fix | Delete
function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {
[345] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[346] Fix | Delete
[347] Fix | Delete
// Right now if one can edit comments, one can delete comments.
[348] Fix | Delete
return user_can_edit_post_comments($user_id, $post_id, $blog_id);
[349] Fix | Delete
}
[350] Fix | Delete
[351] Fix | Delete
/**
[352] Fix | Delete
* Can user can edit other user.
[353] Fix | Delete
*
[354] Fix | Delete
* @since 1.5.0
[355] Fix | Delete
* @deprecated 2.0.0 Use current_user_can()
[356] Fix | Delete
* @see current_user_can()
[357] Fix | Delete
*
[358] Fix | Delete
* @param int $user_id
[359] Fix | Delete
* @param int $other_user
[360] Fix | Delete
* @return bool
[361] Fix | Delete
*/
[362] Fix | Delete
function user_can_edit_user($user_id, $other_user) {
[363] Fix | Delete
_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
[364] Fix | Delete
[365] Fix | Delete
$user = get_userdata($user_id);
[366] Fix | Delete
$other = get_userdata($other_user);
[367] Fix | Delete
if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
[368] Fix | Delete
return true;
[369] Fix | Delete
else
[370] Fix | Delete
return false;
[371] Fix | Delete
}
[372] Fix | Delete
[373] Fix | Delete
/**
[374] Fix | Delete
* Gets the links associated with category $cat_name.
[375] Fix | Delete
*
[376] Fix | Delete
* @since 0.71
[377] Fix | Delete
* @deprecated 2.1.0 Use get_bookmarks()
[378] Fix | Delete
* @see get_bookmarks()
[379] Fix | Delete
*
[380] Fix | Delete
* @param string $cat_name Optional. The category name to use. If no match is found, uses all.
[381] Fix | Delete
* Default 'noname'.
[382] Fix | Delete
* @param string $before Optional. The HTML to output before the link. Default empty.
[383] Fix | Delete
* @param string $after Optional. The HTML to output after the link. Default '<br />'.
[384] Fix | Delete
* @param string $between Optional. The HTML to output between the link/image and its description.
[385] Fix | Delete
* Not used if no image or $show_images is true. Default ' '.
[386] Fix | Delete
* @param bool $show_images Optional. Whether to show images (if defined). Default true.
[387] Fix | Delete
* @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url',
[388] Fix | Delete
* 'description', 'rating', or 'owner'. Default 'id'.
[389] Fix | Delete
* If you start the name with an underscore, the order will be reversed.
[390] Fix | Delete
* Specifying 'rand' as the order will return links in a random order.
[391] Fix | Delete
* @param bool $show_description Optional. Whether to show the description if show_images=false/not defined.
[392] Fix | Delete
* Default true.
[393] Fix | Delete
* @param bool $show_rating Optional. Show rating stars/chars. Default false.
[394] Fix | Delete
* @param int $limit Optional. Limit to X entries. If not specified, all entries are shown.
[395] Fix | Delete
* Default -1.
[396] Fix | Delete
* @param int $show_updated Optional. Whether to show last updated timestamp. Default 0.
[397] Fix | Delete
*/
[398] Fix | Delete
function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
[399] Fix | Delete
$show_description = true, $show_rating = false,
[400] Fix | Delete
$limit = -1, $show_updated = 0) {
[401] Fix | Delete
_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
[402] Fix | Delete
[403] Fix | Delete
$cat_id = -1;
[404] Fix | Delete
$cat = get_term_by('name', $cat_name, 'link_category');
[405] Fix | Delete
if ( $cat )
[406] Fix | Delete
$cat_id = $cat->term_id;
[407] Fix | Delete
[408] Fix | Delete
get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
[409] Fix | Delete
}
[410] Fix | Delete
[411] Fix | Delete
/**
[412] Fix | Delete
* Gets the links associated with the named category.
[413] Fix | Delete
*
[414] Fix | Delete
* @since 1.0.1
[415] Fix | Delete
* @deprecated 2.1.0 Use wp_list_bookmarks()
[416] Fix | Delete
* @see wp_list_bookmarks()
[417] Fix | Delete
*
[418] Fix | Delete
* @param string $category The category to use.
[419] Fix | Delete
* @param string $args
[420] Fix | Delete
* @return string|null
[421] Fix | Delete
*/
[422] Fix | Delete
function wp_get_linksbyname($category, $args = '') {
[423] Fix | Delete
_deprecated_function(__FUNCTION__, '2.1.0', 'wp_list_bookmarks()');
[424] Fix | Delete
[425] Fix | Delete
$defaults = array(
[426] Fix | Delete
'after' => '<br />',
[427] Fix | Delete
'before' => '',
[428] Fix | Delete
'categorize' => 0,
[429] Fix | Delete
'category_after' => '',
[430] Fix | Delete
'category_before' => '',
[431] Fix | Delete
'category_name' => $category,
[432] Fix | Delete
'show_description' => 1,
[433] Fix | Delete
'title_li' => '',
[434] Fix | Delete
);
[435] Fix | Delete
[436] Fix | Delete
$parsed_args = wp_parse_args( $args, $defaults );
[437] Fix | Delete
[438] Fix | Delete
return wp_list_bookmarks($parsed_args);
[439] Fix | Delete
}
[440] Fix | Delete
[441] Fix | Delete
/**
[442] Fix | Delete
* Gets an array of link objects associated with category $cat_name.
[443] Fix | Delete
*
[444] Fix | Delete
* $links = get_linkobjectsbyname( 'fred' );
[445] Fix | Delete
* foreach ( $links as $link ) {
[446] Fix | Delete
* echo '<li>' . $link->link_name . '</li>';
[447] Fix | Delete
* }
[448] Fix | Delete
*
[449] Fix | Delete
* @since 1.0.1
[450] Fix | Delete
* @deprecated 2.1.0 Use get_bookmarks()
[451] Fix | Delete
* @see get_bookmarks()
[452] Fix | Delete
*
[453] Fix | Delete
* @param string $cat_name Optional. The category name to use. If no match is found, uses all.
[454] Fix | Delete
* Default 'noname'.
[455] Fix | Delete
* @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url',
[456] Fix | Delete
* 'description', 'rating', or 'owner'. Default 'name'.
[457] Fix | Delete
* If you start the name with an underscore, the order will be reversed.
[458] Fix | Delete
* Specifying 'rand' as the order will return links in a random order.
[459] Fix | Delete
* @param int $limit Optional. Limit to X entries. If not specified, all entries are shown.
[460] Fix | Delete
* Default -1.
[461] Fix | Delete
* @return array
[462] Fix | Delete
*/
[463] Fix | Delete
function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
[464] Fix | Delete
_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
[465] Fix | Delete
[466] Fix | Delete
$cat_id = -1;
[467] Fix | Delete
$cat = get_term_by('name', $cat_name, 'link_category');
[468] Fix | Delete
if ( $cat )
[469] Fix | Delete
$cat_id = $cat->term_id;
[470] Fix | Delete
[471] Fix | Delete
return get_linkobjects($cat_id, $orderby, $limit);
[472] Fix | Delete
}
[473] Fix | Delete
[474] Fix | Delete
/**
[475] Fix | Delete
* Gets an array of link objects associated with category n.
[476] Fix | Delete
*
[477] Fix | Delete
* Usage:
[478] Fix | Delete
*
[479] Fix | Delete
* $links = get_linkobjects(1);
[480] Fix | Delete
* if ($links) {
[481] Fix | Delete
* foreach ($links as $link) {
[482] Fix | Delete
* echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';
[483] Fix | Delete
* }
[484] Fix | Delete
* }
[485] Fix | Delete
*
[486] Fix | Delete
* Fields are:
[487] Fix | Delete
*
[488] Fix | Delete
* - link_id
[489] Fix | Delete
* - link_url
[490] Fix | Delete
* - link_name
[491] Fix | Delete
* - link_image
[492] Fix | Delete
* - link_target
[493] Fix | Delete
* - link_category
[494] Fix | Delete
* - link_description
[495] Fix | Delete
* - link_visible
[496] Fix | Delete
* - link_owner
[497] Fix | Delete
* - link_rating
[498] Fix | Delete
* - link_updated
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function