web/wp-includes/deprecated.php
branchwordpress
changeset 109 03b0d1493584
child 132 4d4862461b8d
equal deleted inserted replaced
-1:000000000000 109:03b0d1493584
       
     1 <?php
       
     2 /**
       
     3  * Deprecated functions from past WordPress versions. You shouldn't use these
       
     4  * globals and functions and look for the alternatives instead. The functions
       
     5  * and globals will be removed in a later version.
       
     6  *
       
     7  * @package WordPress
       
     8  * @subpackage Deprecated
       
     9  */
       
    10 
       
    11 /*
       
    12  * Deprecated global variables.
       
    13  */
       
    14 
       
    15 /**
       
    16  * The name of the Posts table
       
    17  * @global string $tableposts
       
    18  * @deprecated Use $wpdb->posts
       
    19  */
       
    20 $tableposts = $wpdb->posts;
       
    21 
       
    22 /**
       
    23  * The name of the Users table
       
    24  * @global string $tableusers
       
    25  * @deprecated Use $wpdb->users
       
    26  */
       
    27 $tableusers = $wpdb->users;
       
    28 
       
    29 /**
       
    30  * The name of the Categories table
       
    31  * @global string $tablecategories
       
    32  * @deprecated Use $wpdb->categories
       
    33  */
       
    34 $tablecategories = $wpdb->categories;
       
    35 
       
    36 /**
       
    37  * The name of the post to category table
       
    38  * @global string $tablepost2cat
       
    39  * @deprecated Use $wpdb->post2cat;
       
    40  */
       
    41 $tablepost2cat = $wpdb->post2cat;
       
    42 
       
    43 /**
       
    44  * The name of the comments table
       
    45  * @global string $tablecomments
       
    46  * @deprecated Use $wpdb->comments;
       
    47  */
       
    48 $tablecomments = $wpdb->comments;
       
    49 
       
    50 /**
       
    51  * The name of the links table
       
    52  * @global string $tablelinks
       
    53  * @deprecated Use $wpdb->links;
       
    54  */
       
    55 $tablelinks = $wpdb->links;
       
    56 
       
    57 /**
       
    58  * @global string $tablelinkcategories
       
    59  * @deprecated Not used anymore;
       
    60  */
       
    61 $tablelinkcategories = 'linkcategories_is_gone';
       
    62 
       
    63 /**
       
    64  * The name of the options table
       
    65  * @global string $tableoptions
       
    66  * @deprecated Use $wpdb->options;
       
    67  */
       
    68 $tableoptions = $wpdb->options;
       
    69 
       
    70 /**
       
    71  * The name of the postmeta table
       
    72  * @global string $tablepostmeta
       
    73  * @deprecated Use $wpdb->postmeta;
       
    74  */
       
    75 $tablepostmeta = $wpdb->postmeta;
       
    76 
       
    77 /*
       
    78  * Deprecated functions come here to die.
       
    79  */
       
    80 
       
    81 /**
       
    82  * Entire Post data.
       
    83  *
       
    84  * @since 0.71
       
    85  * @deprecated Use get_post()
       
    86  * @see get_post()
       
    87  *
       
    88  * @param int $postid
       
    89  * @return array
       
    90  */
       
    91 function get_postdata($postid) {
       
    92 	_deprecated_function(__FUNCTION__, '0.0', 'get_post()');
       
    93 
       
    94 	$post = &get_post($postid);
       
    95 
       
    96 	$postdata = array (
       
    97 		'ID' => $post->ID,
       
    98 		'Author_ID' => $post->post_author,
       
    99 		'Date' => $post->post_date,
       
   100 		'Content' => $post->post_content,
       
   101 		'Excerpt' => $post->post_excerpt,
       
   102 		'Title' => $post->post_title,
       
   103 		'Category' => $post->post_category,
       
   104 		'post_status' => $post->post_status,
       
   105 		'comment_status' => $post->comment_status,
       
   106 		'ping_status' => $post->ping_status,
       
   107 		'post_password' => $post->post_password,
       
   108 		'to_ping' => $post->to_ping,
       
   109 		'pinged' => $post->pinged,
       
   110 		'post_type' => $post->post_type,
       
   111 		'post_name' => $post->post_name
       
   112 	);
       
   113 
       
   114 	return $postdata;
       
   115 }
       
   116 
       
   117 /**
       
   118  * Sets up the WordPress Loop.
       
   119  *
       
   120  * @since 1.0.1
       
   121  * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop}
       
   122  */
       
   123 function start_wp() {
       
   124 	global $wp_query, $post;
       
   125 
       
   126 	_deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') );
       
   127 
       
   128 	// Since the old style loop is being used, advance the query iterator here.
       
   129 	$wp_query->next_post();
       
   130 
       
   131 	setup_postdata($post);
       
   132 }
       
   133 
       
   134 /**
       
   135  * Return or Print Category ID.
       
   136  *
       
   137  * @since 0.71
       
   138  * @deprecated use get_the_category()
       
   139  * @see get_the_category()
       
   140  *
       
   141  * @param bool $echo
       
   142  * @return null|int
       
   143  */
       
   144 function the_category_ID($echo = true) {
       
   145 	_deprecated_function(__FUNCTION__, '0.0', 'get_the_category()');
       
   146 
       
   147 	// Grab the first cat in the list.
       
   148 	$categories = get_the_category();
       
   149 	$cat = $categories[0]->term_id;
       
   150 
       
   151 	if ( $echo )
       
   152 		echo $cat;
       
   153 
       
   154 	return $cat;
       
   155 }
       
   156 
       
   157 /**
       
   158  * Print category with optional text before and after.
       
   159  *
       
   160  * @since 0.71
       
   161  * @deprecated use get_the_category_by_ID()
       
   162  * @see get_the_category_by_ID()
       
   163  *
       
   164  * @param string $before
       
   165  * @param string $after
       
   166  */
       
   167 function the_category_head($before='', $after='') {
       
   168 	global $currentcat, $previouscat;
       
   169 
       
   170 	_deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()');
       
   171 
       
   172 	// Grab the first cat in the list.
       
   173 	$categories = get_the_category();
       
   174 	$currentcat = $categories[0]->category_id;
       
   175 	if ( $currentcat != $previouscat ) {
       
   176 		echo $before;
       
   177 		echo get_the_category_by_ID($currentcat);
       
   178 		echo $after;
       
   179 		$previouscat = $currentcat;
       
   180 	}
       
   181 }
       
   182 
       
   183 /**
       
   184  * Prints link to the previous post.
       
   185  *
       
   186  * @since 1.5
       
   187  * @deprecated Use previous_post_link()
       
   188  * @see previous_post_link()
       
   189  *
       
   190  * @param string $format
       
   191  * @param string $previous
       
   192  * @param string $title
       
   193  * @param string $in_same_cat
       
   194  * @param int $limitprev
       
   195  * @param string $excluded_categories
       
   196  */
       
   197 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
       
   198 
       
   199 	_deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()');
       
   200 
       
   201 	if ( empty($in_same_cat) || 'no' == $in_same_cat )
       
   202 		$in_same_cat = false;
       
   203 	else
       
   204 		$in_same_cat = true;
       
   205 
       
   206 	$post = get_previous_post($in_same_cat, $excluded_categories);
       
   207 
       
   208 	if ( !$post )
       
   209 		return;
       
   210 
       
   211 	$string = '<a href="'.get_permalink($post->ID).'">'.$previous;
       
   212 	if ( 'yes' == $title )
       
   213 		$string .= apply_filters('the_title', $post->post_title, $post);
       
   214 	$string .= '</a>';
       
   215 	$format = str_replace('%', $string, $format);
       
   216 	echo $format;
       
   217 }
       
   218 
       
   219 /**
       
   220  * Prints link to the next post.
       
   221  *
       
   222  * @since 0.71
       
   223  * @deprecated Use next_post_link()
       
   224  * @see next_post_link()
       
   225  *
       
   226  * @param string $format
       
   227  * @param string $previous
       
   228  * @param string $title
       
   229  * @param string $in_same_cat
       
   230  * @param int $limitprev
       
   231  * @param string $excluded_categories
       
   232  */
       
   233 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
       
   234 	_deprecated_function(__FUNCTION__, '0.0', 'next_post_link()');
       
   235 
       
   236 	if ( empty($in_same_cat) || 'no' == $in_same_cat )
       
   237 		$in_same_cat = false;
       
   238 	else
       
   239 		$in_same_cat = true;
       
   240 
       
   241 	$post = get_next_post($in_same_cat, $excluded_categories);
       
   242 
       
   243 	if ( !$post	)
       
   244 		return;
       
   245 
       
   246 	$string = '<a href="'.get_permalink($post->ID).'">'.$next;
       
   247 	if ( 'yes' == $title )
       
   248 		$string .= apply_filters('the_title', $post->post_title, $nextpost);
       
   249 	$string .= '</a>';
       
   250 	$format = str_replace('%', $string, $format);
       
   251 	echo $format;
       
   252 }
       
   253 
       
   254 /**
       
   255  * Whether user can create a post.
       
   256  *
       
   257  * @since 1.5
       
   258  * @deprecated Use current_user_can()
       
   259  * @see current_user_can()
       
   260  *
       
   261  * @param int $user_id
       
   262  * @param int $blog_id Not Used
       
   263  * @param int $category_id Not Used
       
   264  * @return bool
       
   265  */
       
   266 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
       
   267 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   268 
       
   269 	$author_data = get_userdata($user_id);
       
   270 	return ($author_data->user_level > 1);
       
   271 }
       
   272 
       
   273 /**
       
   274  * Whether user can create a post.
       
   275  *
       
   276  * @since 1.5
       
   277  * @deprecated Use current_user_can()
       
   278  * @see current_user_can()
       
   279  *
       
   280  * @param int $user_id
       
   281  * @param int $blog_id Not Used
       
   282  * @param int $category_id Not Used
       
   283  * @return bool
       
   284  */
       
   285 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
       
   286 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   287 
       
   288 	$author_data = get_userdata($user_id);
       
   289 	return ($author_data->user_level >= 1);
       
   290 }
       
   291 
       
   292 /**
       
   293  * Whether user can edit a post.
       
   294  *
       
   295  * @since 1.5
       
   296  * @deprecated Use current_user_can()
       
   297  * @see current_user_can()
       
   298  *
       
   299  * @param int $user_id
       
   300  * @param int $post_id
       
   301  * @param int $blog_id Not Used
       
   302  * @return bool
       
   303  */
       
   304 function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
       
   305 	_deprecated_function(__FUNCTION__, '0', 'current_user_can()');
       
   306 
       
   307 	$author_data = get_userdata($user_id);
       
   308 	$post = get_post($post_id);
       
   309 	$post_author_data = get_userdata($post->post_author);
       
   310 
       
   311 	if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' &&  $author_data->user_level < 2))
       
   312 			 || ($author_data->user_level > $post_author_data->user_level)
       
   313 			 || ($author_data->user_level >= 10) ) {
       
   314 		return true;
       
   315 	} else {
       
   316 		return false;
       
   317 	}
       
   318 }
       
   319 
       
   320 /**
       
   321  * Whether user can delete a post.
       
   322  *
       
   323  * @since 1.5
       
   324  * @deprecated Use current_user_can()
       
   325  * @see current_user_can()
       
   326  *
       
   327  * @param int $user_id
       
   328  * @param int $post_id
       
   329  * @param int $blog_id Not Used
       
   330  * @return bool
       
   331  */
       
   332 function user_can_delete_post($user_id, $post_id, $blog_id = 1) {
       
   333 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   334 
       
   335 	// right now if one can edit, one can delete
       
   336 	return user_can_edit_post($user_id, $post_id, $blog_id);
       
   337 }
       
   338 
       
   339 /**
       
   340  * Whether user can set new posts' dates.
       
   341  *
       
   342  * @since 1.5
       
   343  * @deprecated Use current_user_can()
       
   344  * @see current_user_can()
       
   345  *
       
   346  * @param int $user_id
       
   347  * @param int $blog_id Not Used
       
   348  * @param int $category_id Not Used
       
   349  * @return bool
       
   350  */
       
   351 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {
       
   352 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   353 
       
   354 	$author_data = get_userdata($user_id);
       
   355 	return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));
       
   356 }
       
   357 
       
   358 /**
       
   359  * Whether user can delete a post.
       
   360  *
       
   361  * @since 1.5
       
   362  * @deprecated Use current_user_can()
       
   363  * @see current_user_can()
       
   364  *
       
   365  * @param int $user_id
       
   366  * @param int $post_id
       
   367  * @param int $blog_id Not Used
       
   368  * @return bool returns true if $user_id can edit $post_id's date
       
   369  */
       
   370 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {
       
   371 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   372 
       
   373 	$author_data = get_userdata($user_id);
       
   374 	return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));
       
   375 }
       
   376 
       
   377 /**
       
   378  * Whether user can delete a post.
       
   379  *
       
   380  * @since 1.5
       
   381  * @deprecated Use current_user_can()
       
   382  * @see current_user_can()
       
   383  *
       
   384  * @param int $user_id
       
   385  * @param int $post_id
       
   386  * @param int $blog_id Not Used
       
   387  * @return bool returns true if $user_id can edit $post_id's comments
       
   388  */
       
   389 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {
       
   390 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   391 
       
   392 	// right now if one can edit a post, one can edit comments made on it
       
   393 	return user_can_edit_post($user_id, $post_id, $blog_id);
       
   394 }
       
   395 
       
   396 /**
       
   397  * Whether user can delete a post.
       
   398  *
       
   399  * @since 1.5
       
   400  * @deprecated Use current_user_can()
       
   401  * @see current_user_can()
       
   402  *
       
   403  * @param int $user_id
       
   404  * @param int $post_id
       
   405  * @param int $blog_id Not Used
       
   406  * @return bool returns true if $user_id can delete $post_id's comments
       
   407  */
       
   408 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {
       
   409 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   410 
       
   411 	// right now if one can edit comments, one can delete comments
       
   412 	return user_can_edit_post_comments($user_id, $post_id, $blog_id);
       
   413 }
       
   414 
       
   415 /**
       
   416  * Can user can edit other user.
       
   417  *
       
   418  * @since 1.5
       
   419  * @deprecated Use current_user_can()
       
   420  * @see current_user_can()
       
   421  *
       
   422  * @param int $user_id
       
   423  * @param int $other_user
       
   424  * @return bool
       
   425  */
       
   426 function user_can_edit_user($user_id, $other_user) {
       
   427 	_deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
       
   428 
       
   429 	$user  = get_userdata($user_id);
       
   430 	$other = get_userdata($other_user);
       
   431 	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
       
   432 		return true;
       
   433 	else
       
   434 		return false;
       
   435 }
       
   436 
       
   437 /**
       
   438  * Gets the links associated with category $cat_name.
       
   439  *
       
   440  * @since 0.71
       
   441  * @deprecated Use get_links()
       
   442  * @see get_links()
       
   443  *
       
   444  * @param string $cat_name Optional. The category name to use. If no match is found uses all.
       
   445  * @param string $before Optional. The html to output before the link.
       
   446  * @param string $after Optional. The html to output after the link.
       
   447  * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true.
       
   448  * @param bool $show_images Optional. Whether to show images (if defined).
       
   449  * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner.
       
   450  *		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
       
   451  *		random order.
       
   452  * @param bool $show_description Optional. Whether to show the description if show_images=false/not defined.
       
   453  * @param bool $show_rating Optional. Show rating stars/chars.
       
   454  * @param int $limit		Optional. Limit to X entries. If not specified, all entries are shown.
       
   455  * @param int $show_updated Optional. Whether to show last updated timestamp
       
   456  */
       
   457 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
       
   458 						 $show_description = true, $show_rating = false,
       
   459 						 $limit = -1, $show_updated = 0) {
       
   460 	_deprecated_function(__FUNCTION__, '0.0', 'get_links()');
       
   461 
       
   462 	$cat_id = -1;
       
   463 	$cat = get_term_by('name', $cat_name, 'link_category');
       
   464 	if ( $cat )
       
   465 		$cat_id = $cat->term_id;
       
   466 
       
   467 	get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
       
   468 }
       
   469 
       
   470 /**
       
   471  * Gets the links associated with the named category.
       
   472  *
       
   473  * @since 1.0.1
       
   474  * @deprecated Use wp_get_links()
       
   475  * @see wp_get_links()
       
   476  *
       
   477  * @param string $category The category to use.
       
   478  * @param string $args
       
   479  * @return bool|null
       
   480  */
       
   481 function wp_get_linksbyname($category, $args = '') {
       
   482 	_deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()');
       
   483 
       
   484 	$cat = get_term_by('name', $category, 'link_category');
       
   485 	if ( !$cat )
       
   486 		return false;
       
   487 	$cat_id = $cat->term_id;
       
   488 
       
   489 	$args = add_query_arg('category', $cat_id, $args);
       
   490 	wp_get_links($args);
       
   491 }
       
   492 
       
   493 /**
       
   494  * Gets an array of link objects associated with category $cat_name.
       
   495  *
       
   496  * <code>
       
   497  *	$links = get_linkobjectsbyname('fred');
       
   498  *	foreach ($links as $link) {
       
   499  * 		echo '<li>'.$link->link_name.'</li>';
       
   500  *	}
       
   501  * </code>
       
   502  *
       
   503  * @since 1.0.1
       
   504  * @deprecated Use get_linkobjects()
       
   505  * @see get_linkobjects()
       
   506  *
       
   507  * @param string $cat_name The category name to use. If no match is found uses all.
       
   508  * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'.
       
   509  *		Or maybe owner. If you start the name with an underscore the order will be reversed. You can also
       
   510  *		specify 'rand' as the order which will return links in a random order.
       
   511  * @param int $limit Limit to X entries. If not specified, all entries are shown.
       
   512  * @return unknown
       
   513  */
       
   514 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
       
   515 	_deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()');
       
   516 
       
   517 	$cat_id = -1;
       
   518 	$cat = get_term_by('name', $cat_name, 'link_category');
       
   519 	if ( $cat )
       
   520 		$cat_id = $cat->term_id;
       
   521 
       
   522 	return get_linkobjects($cat_id, $orderby, $limit);
       
   523 }
       
   524 
       
   525 /**
       
   526  * Gets an array of link objects associated with category n.
       
   527  *
       
   528  * Usage:
       
   529  * <code>
       
   530  *	$links = get_linkobjects(1);
       
   531  *	if ($links) {
       
   532  *		foreach ($links as $link) {
       
   533  *			echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';
       
   534  *		}
       
   535  *	}
       
   536  * </code>
       
   537  *
       
   538  * Fields are:
       
   539  * <ol>
       
   540  *	<li>link_id</li>
       
   541  *	<li>link_url</li>
       
   542  *	<li>link_name</li>
       
   543  *	<li>link_image</li>
       
   544  *	<li>link_target</li>
       
   545  *	<li>link_category</li>
       
   546  *	<li>link_description</li>
       
   547  *	<li>link_visible</li>
       
   548  *	<li>link_owner</li>
       
   549  *	<li>link_rating</li>
       
   550  *	<li>link_updated</li>
       
   551  *	<li>link_rel</li>
       
   552  *	<li>link_notes</li>
       
   553  * </ol>
       
   554  *
       
   555  * @since 1.0.1
       
   556  * @deprecated Use get_bookmarks()
       
   557  * @see get_bookmarks()
       
   558  *
       
   559  * @param int $category The category to use. If no category supplied uses all
       
   560  * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
       
   561  *		'description', or 'rating'. Or maybe owner. If you start the name with an
       
   562  *		underscore the order will be reversed. You can also specify 'rand' as the
       
   563  *		order which will return links in a random order.
       
   564  * @param int $limit Limit to X entries. If not specified, all entries are shown.
       
   565  * @return unknown
       
   566  */
       
   567 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
       
   568 	_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
       
   569 
       
   570 	$links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit");
       
   571 
       
   572 	$links_array = array();
       
   573 	foreach ($links as $link)
       
   574 		$links_array[] = $link;
       
   575 
       
   576 	return $links_array;
       
   577 }
       
   578 
       
   579 /**
       
   580  * Gets the links associated with category 'cat_name' and display rating stars/chars.
       
   581  *
       
   582  * @since 0.71
       
   583  * @deprecated Use get_bookmarks()
       
   584  * @see get_bookmarks()
       
   585  *
       
   586  * @param string $cat_name The category name to use. If no match is found uses all
       
   587  * @param string $before The html to output before the link
       
   588  * @param string $after The html to output after the link
       
   589  * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images is true
       
   590  * @param bool $show_images Whether to show images (if defined).
       
   591  * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
       
   592  *		'description', or 'rating'. Or maybe owner. If you start the name with an
       
   593  *		underscore the order will be reversed. You can also specify 'rand' as the
       
   594  *		order which will return links in a random order.
       
   595  * @param bool $show_description Whether to show the description if show_images=false/not defined
       
   596  * @param int $limit Limit to X entries. If not specified, all entries are shown.
       
   597  * @param int $show_updated Whether to show last updated timestamp
       
   598  */
       
   599 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
       
   600 									$show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
       
   601 	_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
       
   602 
       
   603 	get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
       
   604 }
       
   605 
       
   606 /**
       
   607  * Gets the links associated with category n and display rating stars/chars.
       
   608  *
       
   609  * @since 0.71
       
   610  * @deprecated Use get_bookmarks()
       
   611  * @see get_bookmarks()
       
   612  *
       
   613  * @param int $category The category to use. If no category supplied uses all
       
   614  * @param string $before The html to output before the link
       
   615  * @param string $after The html to output after the link
       
   616  * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true
       
   617  * @param bool $show_images Whether to show images (if defined).
       
   618  * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url',
       
   619  *		'description', or 'rating'. Or maybe owner. If you start the name with an
       
   620  *		underscore the order will be reversed. You can also specify 'rand' as the
       
   621  *		order which will return links in a random order.
       
   622  * @param bool $show_description Whether to show the description if show_images=false/not defined.
       
   623  * @param string $limit Limit to X entries. If not specified, all entries are shown.
       
   624  * @param int $show_updated Whether to show last updated timestamp
       
   625  */
       
   626 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true,
       
   627 							  $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
       
   628 	_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
       
   629 
       
   630 	get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
       
   631 }
       
   632 
       
   633 /**
       
   634  * Gets the auto_toggle setting.
       
   635  *
       
   636  * @since 0.71
       
   637  * @deprecated No alternative function available
       
   638  *
       
   639  * @param int $id The category to get. If no category supplied uses 0
       
   640  * @return int Only returns 0.
       
   641  */
       
   642 function get_autotoggle($id = 0) {
       
   643 	_deprecated_function(__FUNCTION__, '0.0' );
       
   644 	return 0;
       
   645 }
       
   646 
       
   647 /**
       
   648  * @since 0.71
       
   649  * @deprecated Use wp_list_categories()
       
   650  * @see wp_list_categories()
       
   651  *
       
   652  * @param int $optionall
       
   653  * @param string $all
       
   654  * @param string $sort_column
       
   655  * @param string $sort_order
       
   656  * @param string $file
       
   657  * @param bool $list
       
   658  * @param int $optiondates
       
   659  * @param int $optioncount
       
   660  * @param int $hide_empty
       
   661  * @param int $use_desc_for_title
       
   662  * @param bool $children
       
   663  * @param int $child_of
       
   664  * @param int $categories
       
   665  * @param int $recurse
       
   666  * @param string $feed
       
   667  * @param string $feed_image
       
   668  * @param string $exclude
       
   669  * @param bool $hierarchical
       
   670  * @return unknown
       
   671  */
       
   672 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0,
       
   673 				   $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0,
       
   674 				   $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) {
       
   675 	_deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()');
       
   676 
       
   677 	$query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children',
       
   678 		'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical');
       
   679 	return wp_list_cats($query);
       
   680 }
       
   681 
       
   682 /**
       
   683  * @since 1.2
       
   684  * @deprecated Use wp_list_categories()
       
   685  * @see wp_list_categories()
       
   686  *
       
   687  * @param string|array $args
       
   688  * @return unknown
       
   689  */
       
   690 function wp_list_cats($args = '') {
       
   691 	_deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()');
       
   692 
       
   693 	$r = wp_parse_args( $args );
       
   694 
       
   695 	// Map to new names.
       
   696 	if ( isset($r['optionall']) && isset($r['all']))
       
   697 		$r['show_option_all'] = $r['all'];
       
   698 	if ( isset($r['sort_column']) )
       
   699 		$r['orderby'] = $r['sort_column'];
       
   700 	if ( isset($r['sort_order']) )
       
   701 		$r['order'] = $r['sort_order'];
       
   702 	if ( isset($r['optiondates']) )
       
   703 		$r['show_last_update'] = $r['optiondates'];
       
   704 	if ( isset($r['optioncount']) )
       
   705 		$r['show_count'] = $r['optioncount'];
       
   706 	if ( isset($r['list']) )
       
   707 		$r['style'] = $r['list'] ? 'list' : 'break';
       
   708 	$r['title_li'] = '';
       
   709 
       
   710 	return wp_list_categories($r);
       
   711 }
       
   712 
       
   713 /**
       
   714  * @since 0.71
       
   715  * @deprecated Use wp_dropdown_categories()
       
   716  * @see wp_dropdown_categories()
       
   717  *
       
   718  * @param int $optionall
       
   719  * @param string $all
       
   720  * @param string $orderby
       
   721  * @param string $order
       
   722  * @param int $show_last_update
       
   723  * @param int $show_count
       
   724  * @param int $hide_empty
       
   725  * @param bool $optionnone
       
   726  * @param int $selected
       
   727  * @param int $exclude
       
   728  * @return unknown
       
   729  */
       
   730 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
       
   731 		$show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
       
   732 		$selected = 0, $exclude = 0) {
       
   733 	_deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()');
       
   734 
       
   735 	$show_option_all = '';
       
   736 	if ( $optionall )
       
   737 		$show_option_all = $all;
       
   738 
       
   739 	$show_option_none = '';
       
   740 	if ( $optionnone )
       
   741 		$show_option_none = __('None');
       
   742 
       
   743 	$vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
       
   744 					'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
       
   745 	$query = add_query_arg($vars, '');
       
   746 	return wp_dropdown_categories($query);
       
   747 }
       
   748 
       
   749 /**
       
   750  * @since 2.1
       
   751  * @deprecated Use wp_tiny_mce().
       
   752  * @see wp_tiny_mce()
       
   753  */
       
   754 function tinymce_include() {
       
   755 	_deprecated_function(__FUNCTION__, '0.0', 'wp_tiny_mce()');
       
   756 
       
   757 	wp_tiny_mce();
       
   758 }
       
   759 
       
   760 /**
       
   761  * @since 1.2
       
   762  * @deprecated Use wp_list_authors()
       
   763  * @see wp_list_authors()
       
   764  *
       
   765  * @param bool $optioncount
       
   766  * @param bool $exclude_admin
       
   767  * @param bool $show_fullname
       
   768  * @param bool $hide_empty
       
   769  * @param string $feed
       
   770  * @param string $feed_image
       
   771  * @return unknown
       
   772  */
       
   773 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
       
   774 	_deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()');
       
   775 
       
   776 	$args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
       
   777 	return wp_list_authors($args);
       
   778 }
       
   779 
       
   780 /**
       
   781  * @since 1.0.1
       
   782  * @deprecated Use wp_get_post_categories()
       
   783  * @see wp_get_post_categories()
       
   784  *
       
   785  * @param int $blogid Not Used
       
   786  * @param int $post_ID
       
   787  * @return unknown
       
   788  */
       
   789 function wp_get_post_cats($blogid = '1', $post_ID = 0) {
       
   790 	_deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()');
       
   791 	return wp_get_post_categories($post_ID);
       
   792 }
       
   793 
       
   794 /**
       
   795  * Sets the categories that the post id belongs to.
       
   796  *
       
   797  * @since 1.0.1
       
   798  * @deprecated Use wp_set_post_categories()
       
   799  * @see wp_set_post_categories()
       
   800  *
       
   801  * @param int $blogid Not used
       
   802  * @param int $post_ID
       
   803  * @param array $post_categories
       
   804  * @return unknown
       
   805  */
       
   806 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
       
   807 	_deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()');
       
   808 	return wp_set_post_categories($post_ID, $post_categories);
       
   809 }
       
   810 
       
   811 /**
       
   812  * @since 0.71
       
   813  * @deprecated Use wp_get_archives()
       
   814  * @see wp_get_archives()
       
   815  *
       
   816  * @param string $type
       
   817  * @param string $limit
       
   818  * @param string $format
       
   819  * @param string $before
       
   820  * @param string $after
       
   821  * @param bool $show_post_count
       
   822  * @return unknown
       
   823  */
       
   824 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
       
   825 	_deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()');
       
   826 	$args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count');
       
   827 	return wp_get_archives($args);
       
   828 }
       
   829 
       
   830 /**
       
   831  * Returns or Prints link to the author's posts.
       
   832  *
       
   833  * @since 1.2
       
   834  * @deprecated Use get_author_posts_url()
       
   835  * @see get_author_posts_url()
       
   836  *
       
   837  * @param bool $echo Optional.
       
   838  * @param int $author_id Required.
       
   839  * @param string $author_nicename Optional.
       
   840  * @return string|null
       
   841  */
       
   842 function get_author_link($echo = false, $author_id, $author_nicename = '') {
       
   843 	_deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()');
       
   844 
       
   845 	$link = get_author_posts_url($author_id, $author_nicename);
       
   846 
       
   847 	if ( $echo )
       
   848 		echo $link;
       
   849 	return $link;
       
   850 }
       
   851 
       
   852 /**
       
   853  * Print list of pages based on arguments.
       
   854  *
       
   855  * @since 0.71
       
   856  * @deprecated Use wp_link_pages()
       
   857  * @see wp_link_pages()
       
   858  *
       
   859  * @param string $before
       
   860  * @param string $after
       
   861  * @param string $next_or_number
       
   862  * @param string $nextpagelink
       
   863  * @param string $previouspagelink
       
   864  * @param string $pagelink
       
   865  * @param string $more_file
       
   866  * @return string
       
   867  */
       
   868 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
       
   869 					$pagelink='%', $more_file='') {
       
   870 	_deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()');
       
   871 
       
   872 	$args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');
       
   873 	return wp_link_pages($args);
       
   874 }
       
   875 
       
   876 /**
       
   877  * Get value based on option.
       
   878  *
       
   879  * @since 0.71
       
   880  * @deprecated Use get_option()
       
   881  * @see get_option()
       
   882  *
       
   883  * @param string $option
       
   884  * @return string
       
   885  */
       
   886 function get_settings($option) {
       
   887 	_deprecated_function(__FUNCTION__, '0.0', 'get_option()');
       
   888 
       
   889 	return get_option($option);
       
   890 }
       
   891 
       
   892 /**
       
   893  * Print the permalink of the current post in the loop.
       
   894  *
       
   895  * @since 0.71
       
   896  * @deprecated Use the_permalink()
       
   897  * @see the_permalink()
       
   898  */
       
   899 function permalink_link() {
       
   900 	_deprecated_function(__FUNCTION__, '0.0', 'the_permalink()');
       
   901 	the_permalink();
       
   902 }
       
   903 
       
   904 /**
       
   905  * Print the permalink to the RSS feed.
       
   906  *
       
   907  * @since 0.71
       
   908  * @deprecated Use the_permalink_rss()
       
   909  * @see the_permalink_rss()
       
   910  *
       
   911  * @param string $file
       
   912  */
       
   913 function permalink_single_rss($deprecated = '') {
       
   914 	_deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()');
       
   915 	the_permalink_rss();
       
   916 }
       
   917 
       
   918 /**
       
   919  * Gets the links associated with category.
       
   920  *
       
   921  * @see get_links() for argument information that can be used in $args
       
   922  * @since 1.0.1
       
   923  * @deprecated Use get_bookmarks()
       
   924  * @see get_bookmarks()
       
   925  *
       
   926  * @param string $args a query string
       
   927  * @return null|string
       
   928  */
       
   929 function wp_get_links($args = '') {
       
   930 	_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
       
   931 
       
   932 	if ( strpos( $args, '=' ) === false ) {
       
   933 		$cat_id = $args;
       
   934 		$args = add_query_arg( 'category', $cat_id, $args );
       
   935 	}
       
   936 
       
   937 	$defaults = array(
       
   938 		'category' => -1, 'before' => '',
       
   939 		'after' => '<br />', 'between' => ' ',
       
   940 		'show_images' => true, 'orderby' => 'name',
       
   941 		'show_description' => true, 'show_rating' => false,
       
   942 		'limit' => -1, 'show_updated' => true,
       
   943 		'echo' => true
       
   944 	);
       
   945 
       
   946 	$r = wp_parse_args( $args, $defaults );
       
   947 	extract( $r, EXTR_SKIP );
       
   948 
       
   949 	return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo);
       
   950 }
       
   951 
       
   952 /**
       
   953  * Gets the links associated with category by id.
       
   954  *
       
   955  * @since 0.71
       
   956  * @deprecated Use get_bookmarks()
       
   957  * @see get_bookmarks()
       
   958  *
       
   959  * @param int $category The category to use. If no category supplied uses all
       
   960  * @param string $before the html to output before the link
       
   961  * @param string $after the html to output after the link
       
   962  * @param string $between the html to output between the link/image and its description.
       
   963  *		Not used if no image or show_images == true
       
   964  * @param bool $show_images whether to show images (if defined).
       
   965  * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
       
   966  *		'description', or 'rating'. Or maybe owner. If you start the name with an
       
   967  *		underscore the order will be reversed. You can also specify 'rand' as the order
       
   968  *		which will return links in a random order.
       
   969  * @param bool $show_description whether to show the description if show_images=false/not defined.
       
   970  * @param bool $show_rating show rating stars/chars
       
   971  * @param int $limit Limit to X entries. If not specified, all entries are shown.
       
   972  * @param int $show_updated whether to show last updated timestamp
       
   973  * @param bool $echo whether to echo the results, or return them instead
       
   974  * @return null|string
       
   975  */
       
   976 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
       
   977 			$show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
       
   978 	_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
       
   979 
       
   980 	$order = 'ASC';
       
   981 	if ( substr($orderby, 0, 1) == '_' ) {
       
   982 		$order = 'DESC';
       
   983 		$orderby = substr($orderby, 1);
       
   984 	}
       
   985 
       
   986 	if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
       
   987 		$category = '';
       
   988 
       
   989 	$results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit");
       
   990 
       
   991 	if ( !$results )
       
   992 		return;
       
   993 
       
   994 	$output = '';
       
   995 
       
   996 	foreach ( (array) $results as $row ) {
       
   997 		if ( !isset($row->recently_updated) )
       
   998 			$row->recently_updated = false;
       
   999 		$output .= $before;
       
  1000 		if ( $show_updated && $row->recently_updated )
       
  1001 			$output .= get_option('links_recently_updated_prepend');
       
  1002 		$the_link = '#';
       
  1003 		if ( !empty($row->link_url) )
       
  1004 			$the_link = esc_url($row->link_url);
       
  1005 		$rel = $row->link_rel;
       
  1006 		if ( '' != $rel )
       
  1007 			$rel = ' rel="' . $rel . '"';
       
  1008 
       
  1009 		$desc = esc_attr(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
       
  1010 		$name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
       
  1011 		$title = $desc;
       
  1012 
       
  1013 		if ( $show_updated )
       
  1014 			if (substr($row->link_updated_f, 0, 2) != '00')
       
  1015 				$title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';
       
  1016 
       
  1017 		if ( '' != $title )
       
  1018 			$title = ' title="' . $title . '"';
       
  1019 
       
  1020 		$alt = ' alt="' . $name . '"';
       
  1021 
       
  1022 		$target = $row->link_target;
       
  1023 		if ( '' != $target )
       
  1024 			$target = ' target="' . $target . '"';
       
  1025 
       
  1026 		$output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
       
  1027 
       
  1028 		if ( $row->link_image != null && $show_images ) {
       
  1029 			if ( strpos($row->link_image, 'http') !== false )
       
  1030 				$output .= "<img src=\"$row->link_image\" $alt $title />";
       
  1031 			else // If it's a relative path
       
  1032 				$output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
       
  1033 		} else {
       
  1034 			$output .= $name;
       
  1035 		}
       
  1036 
       
  1037 		$output .= '</a>';
       
  1038 
       
  1039 		if ( $show_updated && $row->recently_updated )
       
  1040 			$output .= get_option('links_recently_updated_append');
       
  1041 
       
  1042 		if ( $show_description && '' != $desc )
       
  1043 			$output .= $between . $desc;
       
  1044 
       
  1045 		if ($show_rating) {
       
  1046 			$output .= $between . get_linkrating($row);
       
  1047 		}
       
  1048 
       
  1049 		$output .= "$after\n";
       
  1050 	} // end while
       
  1051 
       
  1052 	if ( !$echo )
       
  1053 		return $output;
       
  1054 	echo $output;
       
  1055 }
       
  1056 
       
  1057 /**
       
  1058  * Output entire list of links by category.
       
  1059  *
       
  1060  * Output a list of all links, listed by category, using the settings in
       
  1061  * $wpdb->linkcategories and output it as a nested HTML unordered list.
       
  1062  *
       
  1063  * @author Dougal
       
  1064  * @since 1.0.1
       
  1065  * @deprecated Use wp_list_bookmarks()
       
  1066  * @see wp_list_bookmarks()
       
  1067  *
       
  1068  * @param string $order Sort link categories by 'name' or 'id'
       
  1069  * @param string $$deprecated Not Used
       
  1070  */
       
  1071 function get_links_list($order = 'name', $deprecated = '') {
       
  1072 	_deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
       
  1073 
       
  1074 	$order = strtolower($order);
       
  1075 
       
  1076 	// Handle link category sorting
       
  1077 	$direction = 'ASC';
       
  1078 	if ( '_' == substr($order,0,1) ) {
       
  1079 		$direction = 'DESC';
       
  1080 		$order = substr($order,1);
       
  1081 	}
       
  1082 
       
  1083 	if ( !isset($direction) )
       
  1084 		$direction = '';
       
  1085 
       
  1086 	$cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0");
       
  1087 
       
  1088 	// Display each category
       
  1089 	if ( $cats ) {
       
  1090 		foreach ( (array) $cats as $cat ) {
       
  1091 			// Handle each category.
       
  1092 
       
  1093 			// Display the category name
       
  1094 			echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
       
  1095 			// Call get_links() with all the appropriate params
       
  1096 			get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
       
  1097 
       
  1098 			// Close the last category
       
  1099 			echo "\n\t</ul>\n</li>\n";
       
  1100 		}
       
  1101 	}
       
  1102 }
       
  1103 
       
  1104 /**
       
  1105  * Show the link to the links popup and the number of links.
       
  1106  *
       
  1107  * @author Fullo
       
  1108  * @link http://sprite.csr.unibo.it/fullo/
       
  1109  *
       
  1110  * @since 0.71
       
  1111  * @deprecated {@internal Use function instead is unknown}}
       
  1112  *
       
  1113  * @param string $text the text of the link
       
  1114  * @param int $width the width of the popup window
       
  1115  * @param int $height the height of the popup window
       
  1116  * @param string $file the page to open in the popup window
       
  1117  * @param bool $count the number of links in the db
       
  1118  */
       
  1119 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
       
  1120 	_deprecated_function(__FUNCTION__, '0.0' );
       
  1121 
       
  1122 	if ( $count )
       
  1123 		$counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links");
       
  1124 
       
  1125 	$javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">";
       
  1126 	$javascript .= $text;
       
  1127 
       
  1128 	if ( $count )
       
  1129 		$javascript .= " ($counts)";
       
  1130 
       
  1131 	$javascript .= "</a>\n\n";
       
  1132 		echo $javascript;
       
  1133 }
       
  1134 
       
  1135 /**
       
  1136  * @since 1.0.1
       
  1137  * @deprecated Use sanitize_bookmark_field()
       
  1138  * @see sanitize_bookmark_field()
       
  1139  *
       
  1140  * @param object $link
       
  1141  * @return unknown
       
  1142  */
       
  1143 function get_linkrating($link) {
       
  1144 	_deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()');
       
  1145 	return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');
       
  1146 }
       
  1147 
       
  1148 /**
       
  1149  * Gets the name of category by id.
       
  1150  *
       
  1151  * @since 0.71
       
  1152  * @deprecated Use get_category()
       
  1153  * @see get_category()
       
  1154  *
       
  1155  * @param int $id The category to get. If no category supplied uses 0
       
  1156  * @return string
       
  1157  */
       
  1158 function get_linkcatname($id = 0) {
       
  1159 	_deprecated_function(__FUNCTION__, '0.0', 'get_category()');
       
  1160 
       
  1161 	$id = (int) $id;
       
  1162 
       
  1163 	if ( empty($id) )
       
  1164 		return '';
       
  1165 
       
  1166 	$cats = wp_get_link_cats($id);
       
  1167 
       
  1168 	if ( empty($cats) || ! is_array($cats) )
       
  1169 		return '';
       
  1170 
       
  1171 	$cat_id = (int) $cats[0]; // Take the first cat.
       
  1172 
       
  1173 	$cat = get_category($cat_id);
       
  1174 	return $cat->name;
       
  1175 }
       
  1176 
       
  1177 /**
       
  1178  * Print RSS comment feed link.
       
  1179  *
       
  1180  * @since 1.0.1
       
  1181  * @deprecated Use post_comments_feed_link()
       
  1182  * @see post_comments_feed_link()
       
  1183  *
       
  1184  * @param string $link_text
       
  1185  * @param string $deprecated Not used
       
  1186  */
       
  1187 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') {
       
  1188 	_deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()');
       
  1189 	post_comments_feed_link($link_text);
       
  1190 }
       
  1191 
       
  1192 /**
       
  1193  * Print/Return link to category RSS2 feed.
       
  1194  *
       
  1195  * @since 1.2
       
  1196  * @deprecated Use get_category_feed_link()
       
  1197  * @see get_category_feed_link()
       
  1198  *
       
  1199  * @param bool $echo
       
  1200  * @param int $cat_ID
       
  1201  * @param string $deprecated Not used
       
  1202  * @return string|null
       
  1203  */
       
  1204 function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') {
       
  1205 	_deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()');
       
  1206 
       
  1207 	$link = get_category_feed_link($cat_ID, 'rss2');
       
  1208 
       
  1209 	if ( $echo )
       
  1210 		echo $link;
       
  1211 	return $link;
       
  1212 }
       
  1213 
       
  1214 /**
       
  1215  * Print/Return link to author RSS feed.
       
  1216  *
       
  1217  * @since 1.2
       
  1218  * @deprecated Use get_author_feed_link()
       
  1219  * @see get_author_feed_link()
       
  1220  *
       
  1221  * @param bool $echo
       
  1222  * @param int $author_id
       
  1223  * @param string $deprecated Not used
       
  1224  * @return string|null
       
  1225  */
       
  1226 function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') {
       
  1227 	_deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()');
       
  1228 
       
  1229 	$link = get_author_feed_link($author_id);
       
  1230 	if ( $echo )
       
  1231 		echo $link;
       
  1232 	return $link;
       
  1233 }
       
  1234 
       
  1235 /**
       
  1236  * Return link to the post RSS feed.
       
  1237  *
       
  1238  * @since 1.5
       
  1239  * @deprecated Use get_post_comments_feed_link()
       
  1240  * @see get_post_comments_feed_link()
       
  1241  *
       
  1242  * @param string $deprecated Not used
       
  1243  * @return string
       
  1244  */
       
  1245 function comments_rss($deprecated = '') {
       
  1246 	_deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()');
       
  1247 	return get_post_comments_feed_link();
       
  1248 }
       
  1249 
       
  1250 /**
       
  1251  * An alias of wp_create_user().
       
  1252  *
       
  1253  * @param string $username The user's username.
       
  1254  * @param string $password The user's password.
       
  1255  * @param string $email The user's email (optional).
       
  1256  * @return int The new user's ID.
       
  1257  * @deprecated Use wp_create_user()
       
  1258  * @see wp_create_user()
       
  1259  */
       
  1260 function create_user($username, $password, $email) {
       
  1261 	_deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' );
       
  1262 	return wp_create_user($username, $password, $email);
       
  1263 }
       
  1264 
       
  1265 /**
       
  1266  * Unused Admin function.
       
  1267  *
       
  1268  * @since 2.0
       
  1269  * @param string $deprecated Unknown
       
  1270  * @deprecated 2.5
       
  1271  */
       
  1272 function documentation_link( $deprecated = '' ) {
       
  1273 	_deprecated_function( __FUNCTION__, '2.5', '' );
       
  1274 	return;
       
  1275 }
       
  1276 
       
  1277 /**
       
  1278  * Unused function.
       
  1279  *
       
  1280  * @deprecated 2.5
       
  1281 */
       
  1282 function gzip_compression() {
       
  1283 	return false;
       
  1284 }
       
  1285 
       
  1286 /**
       
  1287  * Retrieve an array of comment data about comment $comment_ID.
       
  1288  *
       
  1289  * @deprecated Use get_comment()
       
  1290  * @see get_comment()
       
  1291  * @since 0.71
       
  1292  *
       
  1293  * @uses $id
       
  1294  * @uses $wpdb Database Object
       
  1295  *
       
  1296  * @param int $comment_ID The ID of the comment
       
  1297  * @param int $no_cache Whether to use the cache or not (casted to bool)
       
  1298  * @param bool $include_unapproved Whether to include unapproved comments or not
       
  1299  * @return array The comment data
       
  1300  */
       
  1301 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
       
  1302 	_deprecated_function( __FUNCTION__, '2.7', 'get_comment()' );
       
  1303 	return get_comment($comment_ID, ARRAY_A);
       
  1304 }
       
  1305 
       
  1306 /**
       
  1307  * Retrieve the category name by the category ID.
       
  1308  *
       
  1309  * @since 0.71
       
  1310  * @deprecated Use get_cat_name()
       
  1311  * @see get_cat_name() get_catname() is deprecated in favor of get_cat_name().
       
  1312  *
       
  1313  * @param int $cat_ID Category ID
       
  1314  * @return string category name
       
  1315  */
       
  1316 function get_catname( $cat_ID ) {
       
  1317 	_deprecated_function(__FUNCTION__, '2.8', 'get_cat_name()');
       
  1318 	return get_cat_name( $cat_ID );
       
  1319 }
       
  1320 
       
  1321 /**
       
  1322  * Retrieve category children list separated before and after the term IDs.
       
  1323  *
       
  1324  * @since 1.2.0
       
  1325  *
       
  1326  * @param int $id Category ID to retrieve children.
       
  1327  * @param string $before Optional. Prepend before category term ID.
       
  1328  * @param string $after Optional, default is empty string. Append after category term ID.
       
  1329  * @param array $visited Optional. Category Term IDs that have already been added.
       
  1330  * @return string
       
  1331  */
       
  1332 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) {
       
  1333 	_deprecated_function(__FUNCTION__, '2.8', 'get_term_children()');
       
  1334 	if ( 0 == $id )
       
  1335 		return '';
       
  1336 
       
  1337 	$chain = '';
       
  1338 	/** TODO: consult hierarchy */
       
  1339 	$cat_ids = get_all_category_ids();
       
  1340 	foreach ( (array) $cat_ids as $cat_id ) {
       
  1341 		if ( $cat_id == $id )
       
  1342 			continue;
       
  1343 
       
  1344 		$category = get_category( $cat_id );
       
  1345 		if ( is_wp_error( $category ) )
       
  1346 			return $category;
       
  1347 		if ( $category->parent == $id && !in_array( $category->term_id, $visited ) ) {
       
  1348 			$visited[] = $category->term_id;
       
  1349 			$chain .= $before.$category->term_id.$after;
       
  1350 			$chain .= get_category_children( $category->term_id, $before, $after );
       
  1351 		}
       
  1352 	}
       
  1353 	return $chain;
       
  1354 }
       
  1355 
       
  1356 /**
       
  1357  * Retrieve the description of the author of the current post.
       
  1358  *
       
  1359  * @since 1.5
       
  1360  * @deprecated 2.8
       
  1361  * @uses $authordata The current author's DB object.
       
  1362  * @return string The author's description.
       
  1363  * @deprecated Use the_author_meta('description')
       
  1364  */
       
  1365 function get_the_author_description() {
       
  1366 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' );
       
  1367 	return get_the_author_meta('description');
       
  1368 }
       
  1369 
       
  1370 /**
       
  1371  * Display the description of the author of the current post.
       
  1372  *
       
  1373  * @link http://codex.wordpress.org/Template_Tags/the_author_description
       
  1374  * @since 1.0.0
       
  1375  * @deprecated 2.8
       
  1376  * @deprecated Use the_author_meta('description')
       
  1377  */
       
  1378 function the_author_description() {
       
  1379 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')' );
       
  1380 	the_author_meta('description');
       
  1381 }
       
  1382 
       
  1383 /**
       
  1384  * Retrieve the login name of the author of the current post.
       
  1385  *
       
  1386  * @since 1.5
       
  1387  * @deprecated 2.8
       
  1388  * @uses $authordata The current author's DB object.
       
  1389  * @return string The author's login name (username).
       
  1390  * @deprecated Use the_author_meta('login')
       
  1391  */
       
  1392 function get_the_author_login() {
       
  1393 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' );
       
  1394 	return get_the_author_meta('login');
       
  1395 }
       
  1396 
       
  1397 /**
       
  1398  * Display the login name of the author of the current post.
       
  1399  *
       
  1400  * @link http://codex.wordpress.org/Template_Tags/the_author_login
       
  1401  * @since 0.71
       
  1402  * @deprecated 2.8
       
  1403  * @deprecated Use the_author_meta('login')
       
  1404  */
       
  1405 function the_author_login() {
       
  1406 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'login\')' );
       
  1407 	the_author_meta('login');
       
  1408 }
       
  1409 
       
  1410 /**
       
  1411  * Retrieve the first name of the author of the current post.
       
  1412  *
       
  1413  * @since 1.5
       
  1414  * @deprecated 2.8
       
  1415  * @uses $authordata The current author's DB object.
       
  1416  * @return string The author's first name.
       
  1417  * @deprecated Use the_author_meta('first_name')
       
  1418  */
       
  1419 function get_the_author_firstname() {
       
  1420 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' );
       
  1421 	return get_the_author_meta('first_name');
       
  1422 }
       
  1423 
       
  1424 /**
       
  1425  * Display the first name of the author of the current post.
       
  1426  *
       
  1427  * @link http://codex.wordpress.org/Template_Tags/the_author_firstname
       
  1428  * @since 0.71
       
  1429  * @deprecated 2.8
       
  1430  * @deprecated Use the_author_meta('first_name')
       
  1431  */
       
  1432 function the_author_firstname() {
       
  1433 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' );
       
  1434 	the_author_meta('first_name');
       
  1435 }
       
  1436 
       
  1437 /**
       
  1438  * Retrieve the last name of the author of the current post.
       
  1439  *
       
  1440  * @since 1.5
       
  1441  * @deprecated 2.8
       
  1442  * @uses $authordata The current author's DB object.
       
  1443  * @return string The author's last name.
       
  1444  * @deprecated Use the_author_meta('last_name')
       
  1445  */
       
  1446 function get_the_author_lastname() {
       
  1447 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' );
       
  1448 	return get_the_author_meta('last_name');
       
  1449 }
       
  1450 
       
  1451 /**
       
  1452  * Display the last name of the author of the current post.
       
  1453  *
       
  1454  * @link http://codex.wordpress.org/Template_Tags/the_author_lastname
       
  1455  * @since 0.71
       
  1456  * @deprecated 2.8
       
  1457  * @deprecated Use the_author_meta('last_name')
       
  1458  */
       
  1459 function the_author_lastname() {
       
  1460 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' );
       
  1461 	the_author_meta('last_name');
       
  1462 }
       
  1463 
       
  1464 /**
       
  1465  * Retrieve the nickname of the author of the current post.
       
  1466  *
       
  1467  * @since 1.5
       
  1468  * @deprecated 2.8
       
  1469  * @uses $authordata The current author's DB object.
       
  1470  * @return string The author's nickname.
       
  1471  * @deprecated Use the_author_meta('nickname')
       
  1472  */
       
  1473 function get_the_author_nickname() {
       
  1474 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' );
       
  1475 	return get_the_author_meta('nickname');
       
  1476 }
       
  1477 
       
  1478 /**
       
  1479  * Display the nickname of the author of the current post.
       
  1480  *
       
  1481  * @link http://codex.wordpress.org/Template_Tags/the_author_nickname
       
  1482  * @since 0.71
       
  1483  * @deprecated 2.8
       
  1484  * @deprecated Use the_author_meta('nickname')
       
  1485  */
       
  1486 function the_author_nickname() {
       
  1487 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' );
       
  1488 	the_author_meta('nickname');
       
  1489 }
       
  1490 
       
  1491 /**
       
  1492  * Retrieve the email of the author of the current post.
       
  1493  *
       
  1494  * @since 1.5
       
  1495  * @deprecated 2.8
       
  1496  * @uses $authordata The current author's DB object.
       
  1497  * @return string The author's username.
       
  1498  * @deprecated Use the_author_meta('email')
       
  1499  */
       
  1500 function get_the_author_email() {
       
  1501 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' );
       
  1502 	return get_the_author_meta('email');
       
  1503 }
       
  1504 
       
  1505 /**
       
  1506  * Display the email of the author of the current post.
       
  1507  *
       
  1508  * @link http://codex.wordpress.org/Template_Tags/the_author_email
       
  1509  * @since 0.71
       
  1510  * @deprecated 2.8
       
  1511  * @deprecated Use the_author_meta('email')
       
  1512  */
       
  1513 function the_author_email() {
       
  1514 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'email\')' );
       
  1515 	the_author_meta('email');
       
  1516 }
       
  1517 
       
  1518 /**
       
  1519  * Retrieve the ICQ number of the author of the current post.
       
  1520  *
       
  1521  * @since 1.5
       
  1522  * @deprecated 2.8
       
  1523  * @uses $authordata The current author's DB object.
       
  1524  * @return string The author's ICQ number.
       
  1525  * @deprecated Use the_author_meta('icq')
       
  1526  */
       
  1527 function get_the_author_icq() {
       
  1528 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' );
       
  1529 	return get_the_author_meta('icq');
       
  1530 }
       
  1531 
       
  1532 /**
       
  1533  * Display the ICQ number of the author of the current post.
       
  1534  *
       
  1535  * @link http://codex.wordpress.org/Template_Tags/the_author_icq
       
  1536  * @since 0.71
       
  1537  * @deprecated 2.8
       
  1538  * @see get_the_author_icq()
       
  1539  * @deprecated Use the_author_meta('icq')
       
  1540  */
       
  1541 function the_author_icq() {
       
  1542 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')' );
       
  1543 	the_author_meta('icq');
       
  1544 }
       
  1545 
       
  1546 /**
       
  1547  * Retrieve the Yahoo! IM name of the author of the current post.
       
  1548  *
       
  1549  * @since 1.5
       
  1550  * @deprecated 2.8
       
  1551  * @uses $authordata The current author's DB object.
       
  1552  * @return string The author's Yahoo! IM name.
       
  1553  * @deprecated Use the_author_meta('yim')
       
  1554  */
       
  1555 function get_the_author_yim() {
       
  1556 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' );
       
  1557 	return get_the_author_meta('yim');
       
  1558 }
       
  1559 
       
  1560 /**
       
  1561  * Display the Yahoo! IM name of the author of the current post.
       
  1562  *
       
  1563  * @link http://codex.wordpress.org/Template_Tags/the_author_yim
       
  1564  * @since 0.71
       
  1565  * @deprecated 2.8
       
  1566  * @deprecated Use the_author_meta('yim')
       
  1567  */
       
  1568 function the_author_yim() {
       
  1569 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')' );
       
  1570 	the_author_meta('yim');
       
  1571 }
       
  1572 
       
  1573 /**
       
  1574  * Retrieve the MSN address of the author of the current post.
       
  1575  *
       
  1576  * @since 1.5
       
  1577  * @deprecated 2.8
       
  1578  * @uses $authordata The current author's DB object.
       
  1579  * @return string The author's MSN address.
       
  1580  * @deprecated Use the_author_meta('msn')
       
  1581  */
       
  1582 function get_the_author_msn() {
       
  1583 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' );
       
  1584 	return get_the_author_meta('msn');
       
  1585 }
       
  1586 
       
  1587 /**
       
  1588  * Display the MSN address of the author of the current post.
       
  1589  *
       
  1590  * @link http://codex.wordpress.org/Template_Tags/the_author_msn
       
  1591  * @since 0.71
       
  1592  * @deprecated 2.8
       
  1593  * @see get_the_author_msn()
       
  1594  * @deprecated Use the_author_meta('msn')
       
  1595  */
       
  1596 function the_author_msn() {
       
  1597 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')' );
       
  1598 	the_author_meta('msn');
       
  1599 }
       
  1600 
       
  1601 /**
       
  1602  * Retrieve the AIM address of the author of the current post.
       
  1603  *
       
  1604  * @since 1.5
       
  1605  * @deprecated 2.8
       
  1606  * @uses $authordata The current author's DB object.
       
  1607  * @return string The author's AIM address.
       
  1608  * @deprecated Use the_author_meta('aim')
       
  1609  */
       
  1610 function get_the_author_aim() {
       
  1611 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' );
       
  1612 	return get_the_author_meta('aim');
       
  1613 }
       
  1614 
       
  1615 /**
       
  1616  * Display the AIM address of the author of the current post.
       
  1617  *
       
  1618  * @link http://codex.wordpress.org/Template_Tags/the_author_aim
       
  1619  * @since 0.71
       
  1620  * @deprecated 2.8
       
  1621  * @see get_the_author_aim()
       
  1622  * @deprecated Use the_author_meta('aim')
       
  1623  */
       
  1624 function the_author_aim() {
       
  1625 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'aim\')' );
       
  1626 	the_author_meta('aim');
       
  1627 }
       
  1628 
       
  1629 /**
       
  1630  * Retrieve the specified author's preferred display name.
       
  1631  *
       
  1632  * @since 1.0.0
       
  1633  * @deprecated 2.8
       
  1634  * @param int $auth_id The ID of the author.
       
  1635  * @return string The author's display name.
       
  1636  * @deprecated Use the_author_meta('display_name')
       
  1637  */
       
  1638 function get_author_name( $auth_id = false ) {
       
  1639 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' );
       
  1640 	return get_the_author_meta('display_name', $auth_id);
       
  1641 }
       
  1642 
       
  1643 /**
       
  1644  * Retrieve the URL to the home page of the author of the current post.
       
  1645  *
       
  1646  * @since 1.5
       
  1647  * @deprecated 2.8
       
  1648  * @uses $authordata The current author's DB object.
       
  1649  * @return string The URL to the author's page.
       
  1650  */
       
  1651 function get_the_author_url() {
       
  1652 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' );
       
  1653 	return get_the_author_meta('url');
       
  1654 }
       
  1655 
       
  1656 /**
       
  1657  * Display the URL to the home page of the author of the current post.
       
  1658  *
       
  1659  * @link http://codex.wordpress.org/Template_Tags/the_author_url
       
  1660  * @since 0.71
       
  1661  * @deprecated 2.8
       
  1662  */
       
  1663 function the_author_url() {
       
  1664 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'url\')' );
       
  1665 	the_author_meta('url');
       
  1666 }
       
  1667 
       
  1668 /**
       
  1669  * Retrieve the ID of the author of the current post.
       
  1670  *
       
  1671  * @since 1.5
       
  1672  * @deprecated 2.8
       
  1673  * @return int The author's ID.
       
  1674  */
       
  1675 function get_the_author_ID() {
       
  1676 	_deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' );
       
  1677 	return get_the_author_meta('ID');
       
  1678 }
       
  1679 
       
  1680 /**
       
  1681  * Display the ID of the author of the current post.
       
  1682  *
       
  1683  * @link http://codex.wordpress.org/Template_Tags/the_author_ID
       
  1684  * @since 0.71
       
  1685  * @deprecated 2.8
       
  1686  * @uses get_the_author_ID()
       
  1687 */
       
  1688 function the_author_ID() {
       
  1689 	_deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'ID\')' );
       
  1690 	the_author_meta('ID');
       
  1691 }
       
  1692 
       
  1693 ?>