PageRenderTime 152ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 2ms

/wp-includes/deprecated.php

https://github.com/markjaquith/WordPress
PHP | 4227 lines | 2218 code | 339 blank | 1670 comment | 207 complexity | e7a28cb80375c4aa8002480412fa2ca9 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

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

Large files files are truncated, but you can click here to view the full file