- 70F855DACD4C0CB42BF3987C348D079B8959698F44D25235D47610D5EEFC8E46959451715E67E608982BE91C9452002A349A3C7C235E8491E8DA04997D51452C
+ 8EAD6036EAD04F82727E836BDE5D5A26FFF8DC44E78E2E18D1EF47D02B36FE7EA4DE29917D11334B4CE0C3AB220842CA967E69CEF5BFE5A6F3641A7E4C68BB0A
mp-wp/wp-includes/deprecated.php
(79 . 572)(79 . 6)
35592 */
35593
35594 /**
35595 * Entire Post data.
35596 *
35597 * @since 0.71
35598 * @deprecated Use get_post()
35599 * @see get_post()
35600 *
35601 * @param int $postid
35602 * @return array
35603 */
35604 function get_postdata($postid) {
35605 _deprecated_function(__FUNCTION__, '0.0', 'get_post()');
35606
35607 $post = &get_post($postid);
35608
35609 $postdata = array (
35610 'ID' => $post->ID,
35611 'Author_ID' => $post->post_author,
35612 'Date' => $post->post_date,
35613 'Content' => $post->post_content,
35614 'Excerpt' => $post->post_excerpt,
35615 'Title' => $post->post_title,
35616 'Category' => $post->post_category,
35617 'post_status' => $post->post_status,
35618 'comment_status' => $post->comment_status,
35619 'ping_status' => $post->ping_status,
35620 'post_password' => $post->post_password,
35621 'to_ping' => $post->to_ping,
35622 'pinged' => $post->pinged,
35623 'post_type' => $post->post_type,
35624 'post_name' => $post->post_name
35625 );
35626
35627 return $postdata;
35628 }
35629
35630 /**
35631 * Sets up the WordPress Loop.
35632 *
35633 * @since 1.0.1
35634 * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop}
35635 */
35636 function start_wp() {
35637 global $wp_query, $post;
35638
35639 _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') );
35640
35641 // Since the old style loop is being used, advance the query iterator here.
35642 $wp_query->next_post();
35643
35644 setup_postdata($post);
35645 }
35646
35647 /**
35648 * Return or Print Category ID.
35649 *
35650 * @since 0.71
35651 * @deprecated use get_the_category()
35652 * @see get_the_category()
35653 *
35654 * @param bool $echo
35655 * @return null|int
35656 */
35657 function the_category_ID($echo = true) {
35658 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()');
35659
35660 // Grab the first cat in the list.
35661 $categories = get_the_category();
35662 $cat = $categories[0]->term_id;
35663
35664 if ( $echo )
35665 echo $cat;
35666
35667 return $cat;
35668 }
35669
35670 /**
35671 * Print category with optional text before and after.
35672 *
35673 * @since 0.71
35674 * @deprecated use get_the_category_by_ID()
35675 * @see get_the_category_by_ID()
35676 *
35677 * @param string $before
35678 * @param string $after
35679 */
35680 function the_category_head($before='', $after='') {
35681 global $currentcat, $previouscat;
35682
35683 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()');
35684
35685 // Grab the first cat in the list.
35686 $categories = get_the_category();
35687 $currentcat = $categories[0]->category_id;
35688 if ( $currentcat != $previouscat ) {
35689 echo $before;
35690 echo get_the_category_by_ID($currentcat);
35691 echo $after;
35692 $previouscat = $currentcat;
35693 }
35694 }
35695
35696 /**
35697 * Prints link to the previous post.
35698 *
35699 * @since 1.5
35700 * @deprecated Use previous_post_link()
35701 * @see previous_post_link()
35702 *
35703 * @param string $format
35704 * @param string $previous
35705 * @param string $title
35706 * @param string $in_same_cat
35707 * @param int $limitprev
35708 * @param string $excluded_categories
35709 */
35710 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
35711
35712 _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()');
35713
35714 if ( empty($in_same_cat) || 'no' == $in_same_cat )
35715 $in_same_cat = false;
35716 else
35717 $in_same_cat = true;
35718
35719 $post = get_previous_post($in_same_cat, $excluded_categories);
35720
35721 if ( !$post )
35722 return;
35723
35724 $string = '<a href="'.get_permalink($post->ID).'">'.$previous;
35725 if ( 'yes' == $title )
35726 $string .= apply_filters('the_title', $post->post_title, $post);
35727 $string .= '</a>';
35728 $format = str_replace('%', $string, $format);
35729 echo $format;
35730 }
35731
35732 /**
35733 * Prints link to the next post.
35734 *
35735 * @since 0.71
35736 * @deprecated Use next_post_link()
35737 * @see next_post_link()
35738 *
35739 * @param string $format
35740 * @param string $previous
35741 * @param string $title
35742 * @param string $in_same_cat
35743 * @param int $limitprev
35744 * @param string $excluded_categories
35745 */
35746 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
35747 _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()');
35748
35749 if ( empty($in_same_cat) || 'no' == $in_same_cat )
35750 $in_same_cat = false;
35751 else
35752 $in_same_cat = true;
35753
35754 $post = get_next_post($in_same_cat, $excluded_categories);
35755
35756 if ( !$post )
35757 return;
35758
35759 $string = '<a href="'.get_permalink($post->ID).'">'.$next;
35760 if ( 'yes' == $title )
35761 $string .= apply_filters('the_title', $post->post_title, $nextpost);
35762 $string .= '</a>';
35763 $format = str_replace('%', $string, $format);
35764 echo $format;
35765 }
35766
35767 /**
35768 * Whether user can create a post.
35769 *
35770 * @since 1.5
35771 * @deprecated Use current_user_can()
35772 * @see current_user_can()
35773 *
35774 * @param int $user_id
35775 * @param int $blog_id Not Used
35776 * @param int $category_id Not Used
35777 * @return bool
35778 */
35779 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') {
35780 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35781
35782 $author_data = get_userdata($user_id);
35783 return ($author_data->user_level > 1);
35784 }
35785
35786 /**
35787 * Whether user can create a post.
35788 *
35789 * @since 1.5
35790 * @deprecated Use current_user_can()
35791 * @see current_user_can()
35792 *
35793 * @param int $user_id
35794 * @param int $blog_id Not Used
35795 * @param int $category_id Not Used
35796 * @return bool
35797 */
35798 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') {
35799 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35800
35801 $author_data = get_userdata($user_id);
35802 return ($author_data->user_level >= 1);
35803 }
35804
35805 /**
35806 * Whether user can edit a post.
35807 *
35808 * @since 1.5
35809 * @deprecated Use current_user_can()
35810 * @see current_user_can()
35811 *
35812 * @param int $user_id
35813 * @param int $post_id
35814 * @param int $blog_id Not Used
35815 * @return bool
35816 */
35817 function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
35818 _deprecated_function(__FUNCTION__, '0', 'current_user_can()');
35819
35820 $author_data = get_userdata($user_id);
35821 $post = get_post($post_id);
35822 $post_author_data = get_userdata($post->post_author);
35823
35824 if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2))
35825 || ($author_data->user_level > $post_author_data->user_level)
35826 || ($author_data->user_level >= 10) ) {
35827 return true;
35828 } else {
35829 return false;
35830 }
35831 }
35832
35833 /**
35834 * Whether user can delete a post.
35835 *
35836 * @since 1.5
35837 * @deprecated Use current_user_can()
35838 * @see current_user_can()
35839 *
35840 * @param int $user_id
35841 * @param int $post_id
35842 * @param int $blog_id Not Used
35843 * @return bool
35844 */
35845 function user_can_delete_post($user_id, $post_id, $blog_id = 1) {
35846 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35847
35848 // right now if one can edit, one can delete
35849 return user_can_edit_post($user_id, $post_id, $blog_id);
35850 }
35851
35852 /**
35853 * Whether user can set new posts' dates.
35854 *
35855 * @since 1.5
35856 * @deprecated Use current_user_can()
35857 * @see current_user_can()
35858 *
35859 * @param int $user_id
35860 * @param int $blog_id Not Used
35861 * @param int $category_id Not Used
35862 * @return bool
35863 */
35864 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') {
35865 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35866
35867 $author_data = get_userdata($user_id);
35868 return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id));
35869 }
35870
35871 /**
35872 * Whether user can delete a post.
35873 *
35874 * @since 1.5
35875 * @deprecated Use current_user_can()
35876 * @see current_user_can()
35877 *
35878 * @param int $user_id
35879 * @param int $post_id
35880 * @param int $blog_id Not Used
35881 * @return bool returns true if $user_id can edit $post_id's date
35882 */
35883 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) {
35884 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35885
35886 $author_data = get_userdata($user_id);
35887 return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id));
35888 }
35889
35890 /**
35891 * Whether user can delete a post.
35892 *
35893 * @since 1.5
35894 * @deprecated Use current_user_can()
35895 * @see current_user_can()
35896 *
35897 * @param int $user_id
35898 * @param int $post_id
35899 * @param int $blog_id Not Used
35900 * @return bool returns true if $user_id can edit $post_id's comments
35901 */
35902 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) {
35903 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35904
35905 // right now if one can edit a post, one can edit comments made on it
35906 return user_can_edit_post($user_id, $post_id, $blog_id);
35907 }
35908
35909 /**
35910 * Whether user can delete a post.
35911 *
35912 * @since 1.5
35913 * @deprecated Use current_user_can()
35914 * @see current_user_can()
35915 *
35916 * @param int $user_id
35917 * @param int $post_id
35918 * @param int $blog_id Not Used
35919 * @return bool returns true if $user_id can delete $post_id's comments
35920 */
35921 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) {
35922 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35923
35924 // right now if one can edit comments, one can delete comments
35925 return user_can_edit_post_comments($user_id, $post_id, $blog_id);
35926 }
35927
35928 /**
35929 * Can user can edit other user.
35930 *
35931 * @since 1.5
35932 * @deprecated Use current_user_can()
35933 * @see current_user_can()
35934 *
35935 * @param int $user_id
35936 * @param int $other_user
35937 * @return bool
35938 */
35939 function user_can_edit_user($user_id, $other_user) {
35940 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()');
35941
35942 $user = get_userdata($user_id);
35943 $other = get_userdata($other_user);
35944 if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
35945 return true;
35946 else
35947 return false;
35948 }
35949
35950 /**
35951 * Gets the links associated with category $cat_name.
35952 *
35953 * @since 0.71
35954 * @deprecated Use get_links()
35955 * @see get_links()
35956 *
35957 * @param string $cat_name Optional. The category name to use. If no match is found uses all.
35958 * @param string $before Optional. The html to output before the link.
35959 * @param string $after Optional. The html to output after the link.
35960 * @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.
35961 * @param bool $show_images Optional. Whether to show images (if defined).
35962 * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner.
35963 * 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
35964 * random order.
35965 * @param bool $show_description Optional. Whether to show the description if show_images=false/not defined.
35966 * @param bool $show_rating Optional. Show rating stars/chars.
35967 * @param int $limit Optional. Limit to X entries. If not specified, all entries are shown.
35968 * @param int $show_updated Optional. Whether to show last updated timestamp
35969 */
35970 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',
35971 $show_description = true, $show_rating = false,
35972 $limit = -1, $show_updated = 0) {
35973 _deprecated_function(__FUNCTION__, '0.0', 'get_links()');
35974
35975 $cat_id = -1;
35976 $cat = get_term_by('name', $cat_name, 'link_category');
35977 if ( $cat )
35978 $cat_id = $cat->term_id;
35979
35980 get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);
35981 }
35982
35983 /**
35984 * Gets the links associated with the named category.
35985 *
35986 * @since 1.0.1
35987 * @deprecated Use wp_get_links()
35988 * @see wp_get_links()
35989 *
35990 * @param string $category The category to use.
35991 * @param string $args
35992 * @return bool|null
35993 */
35994 function wp_get_linksbyname($category, $args = '') {
35995 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()');
35996
35997 $cat = get_term_by('name', $category, 'link_category');
35998 if ( !$cat )
35999 return false;
36000 $cat_id = $cat->term_id;
36001
36002 $args = add_query_arg('category', $cat_id, $args);
36003 wp_get_links($args);
36004 }
36005
36006 /**
36007 * Gets an array of link objects associated with category $cat_name.
36008 *
36009 * <code>
36010 * $links = get_linkobjectsbyname('fred');
36011 * foreach ($links as $link) {
36012 * echo '<li>'.$link->link_name.'</li>';
36013 * }
36014 * </code>
36015 *
36016 * @since 1.0.1
36017 * @deprecated Use get_linkobjects()
36018 * @see get_linkobjects()
36019 *
36020 * @param string $cat_name The category name to use. If no match is found uses all.
36021 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'.
36022 * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also
36023 * specify 'rand' as the order which will return links in a random order.
36024 * @param int $limit Limit to X entries. If not specified, all entries are shown.
36025 * @return unknown
36026 */
36027 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
36028 _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()');
36029
36030 $cat_id = -1;
36031 $cat = get_term_by('name', $cat_name, 'link_category');
36032 if ( $cat )
36033 $cat_id = $cat->term_id;
36034
36035 return get_linkobjects($cat_id, $orderby, $limit);
36036 }
36037
36038 /**
36039 * Gets an array of link objects associated with category n.
36040 *
36041 * Usage:
36042 * <code>
36043 * $links = get_linkobjects(1);
36044 * if ($links) {
36045 * foreach ($links as $link) {
36046 * echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>';
36047 * }
36048 * }
36049 * </code>
36050 *
36051 * Fields are:
36052 * <ol>
36053 * <li>link_id</li>
36054 * <li>link_url</li>
36055 * <li>link_name</li>
36056 * <li>link_image</li>
36057 * <li>link_target</li>
36058 * <li>link_category</li>
36059 * <li>link_description</li>
36060 * <li>link_visible</li>
36061 * <li>link_owner</li>
36062 * <li>link_rating</li>
36063 * <li>link_updated</li>
36064 * <li>link_rel</li>
36065 * <li>link_notes</li>
36066 * </ol>
36067 *
36068 * @since 1.0.1
36069 * @deprecated Use get_bookmarks()
36070 * @see get_bookmarks()
36071 *
36072 * @param int $category The category to use. If no category supplied uses all
36073 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
36074 * 'description', or 'rating'. Or maybe owner. If you start the name with an
36075 * underscore the order will be reversed. You can also specify 'rand' as the
36076 * order which will return links in a random order.
36077 * @param int $limit Limit to X entries. If not specified, all entries are shown.
36078 * @return unknown
36079 */
36080 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
36081 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
36082
36083 $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit");
36084
36085 $links_array = array();
36086 foreach ($links as $link)
36087 $links_array[] = $link;
36088
36089 return $links_array;
36090 }
36091
36092 /**
36093 * Gets the links associated with category 'cat_name' and display rating stars/chars.
36094 *
36095 * @since 0.71
36096 * @deprecated Use get_bookmarks()
36097 * @see get_bookmarks()
36098 *
36099 * @param string $cat_name The category name to use. If no match is found uses all
36100 * @param string $before The html to output before the link
36101 * @param string $after The html to output after the link
36102 * @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
36103 * @param bool $show_images Whether to show images (if defined).
36104 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
36105 * 'description', or 'rating'. Or maybe owner. If you start the name with an
36106 * underscore the order will be reversed. You can also specify 'rand' as the
36107 * order which will return links in a random order.
36108 * @param bool $show_description Whether to show the description if show_images=false/not defined
36109 * @param int $limit Limit to X entries. If not specified, all entries are shown.
36110 * @param int $show_updated Whether to show last updated timestamp
36111 */
36112 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ",
36113 $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
36114 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
36115
36116 get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
36117 }
36118
36119 /**
36120 * Gets the links associated with category n and display rating stars/chars.
36121 *
36122 * @since 0.71
36123 * @deprecated Use get_bookmarks()
36124 * @see get_bookmarks()
36125 *
36126 * @param int $category The category to use. If no category supplied uses all
36127 * @param string $before The html to output before the link
36128 * @param string $after The html to output after the link
36129 * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true
36130 * @param bool $show_images Whether to show images (if defined).
36131 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url',
36132 * 'description', or 'rating'. Or maybe owner. If you start the name with an
36133 * underscore the order will be reversed. You can also specify 'rand' as the
36134 * order which will return links in a random order.
36135 * @param bool $show_description Whether to show the description if show_images=false/not defined.
36136 * @param string $limit Limit to X entries. If not specified, all entries are shown.
36137 * @param int $show_updated Whether to show last updated timestamp
36138 */
36139 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true,
36140 $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) {
36141 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
36142
36143 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated);
36144 }
36145
36146 /**
36147 * Gets the auto_toggle setting.
36148 *
36149 * @since 0.71
36150 * @deprecated No alternative function available
36151 *
36152 * @param int $id The category to get. If no category supplied uses 0
36153 * @return int Only returns 0.
36154 */
36155 function get_autotoggle($id = 0) {
36156 _deprecated_function(__FUNCTION__, '0.0' );
36157 return 0;
36158 }
36159
36160 /**
36161 * @since 0.71
36162 * @deprecated Use wp_list_categories()
36163 * @see wp_list_categories()
(710 . 586)(144 . 4)
36165 return wp_list_categories($r);
36166 }
36167
36168 /**
36169 * @since 0.71
36170 * @deprecated Use wp_dropdown_categories()
36171 * @see wp_dropdown_categories()
36172 *
36173 * @param int $optionall
36174 * @param string $all
36175 * @param string $orderby
36176 * @param string $order
36177 * @param int $show_last_update
36178 * @param int $show_count
36179 * @param int $hide_empty
36180 * @param bool $optionnone
36181 * @param int $selected
36182 * @param int $exclude
36183 * @return unknown
36184 */
36185 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
36186 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false,
36187 $selected = 0, $exclude = 0) {
36188 _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()');
36189
36190 $show_option_all = '';
36191 if ( $optionall )
36192 $show_option_all = $all;
36193
36194 $show_option_none = '';
36195 if ( $optionnone )
36196 $show_option_none = __('None');
36197
36198 $vars = compact('show_option_all', 'show_option_none', 'orderby', 'order',
36199 'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude');
36200 $query = add_query_arg($vars, '');
36201 return wp_dropdown_categories($query);
36202 }
36203
36204 /**
36205 * @since 1.2
36206 * @deprecated Use wp_list_authors()
36207 * @see wp_list_authors()
36208 *
36209 * @param bool $optioncount
36210 * @param bool $exclude_admin
36211 * @param bool $show_fullname
36212 * @param bool $hide_empty
36213 * @param string $feed
36214 * @param string $feed_image
36215 * @return unknown
36216 */
36217 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
36218 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()');
36219
36220 $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image');
36221 return wp_list_authors($args);
36222 }
36223
36224 /**
36225 * @since 1.0.1
36226 * @deprecated Use wp_get_post_categories()
36227 * @see wp_get_post_categories()
36228 *
36229 * @param int $blogid Not Used
36230 * @param int $post_ID
36231 * @return unknown
36232 */
36233 function wp_get_post_cats($blogid = '1', $post_ID = 0) {
36234 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()');
36235 return wp_get_post_categories($post_ID);
36236 }
36237
36238 /**
36239 * Sets the categories that the post id belongs to.
36240 *
36241 * @since 1.0.1
36242 * @deprecated Use wp_set_post_categories()
36243 * @see wp_set_post_categories()
36244 *
36245 * @param int $blogid Not used
36246 * @param int $post_ID
36247 * @param array $post_categories
36248 * @return unknown
36249 */
36250 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
36251 _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()');
36252 return wp_set_post_categories($post_ID, $post_categories);
36253 }
36254
36255 /**
36256 * @since 0.71
36257 * @deprecated Use wp_get_archives()
36258 * @see wp_get_archives()
36259 *
36260 * @param string $type
36261 * @param string $limit
36262 * @param string $format
36263 * @param string $before
36264 * @param string $after
36265 * @param bool $show_post_count
36266 * @return unknown
36267 */
36268 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
36269 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()');
36270 $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count');
36271 return wp_get_archives($args);
36272 }
36273
36274 /**
36275 * Returns or Prints link to the author's posts.
36276 *
36277 * @since 1.2
36278 * @deprecated Use get_author_posts_url()
36279 * @see get_author_posts_url()
36280 *
36281 * @param bool $echo Optional.
36282 * @param int $author_id Required.
36283 * @param string $author_nicename Optional.
36284 * @return string|null
36285 */
36286 function get_author_link($echo = false, $author_id, $author_nicename = '') {
36287 _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()');
36288
36289 $link = get_author_posts_url($author_id, $author_nicename);
36290
36291 if ( $echo )
36292 echo $link;
36293 return $link;
36294 }
36295
36296 /**
36297 * Print list of pages based on arguments.
36298 *
36299 * @since 0.71
36300 * @deprecated Use wp_link_pages()
36301 * @see wp_link_pages()
36302 *
36303 * @param string $before
36304 * @param string $after
36305 * @param string $next_or_number
36306 * @param string $nextpagelink
36307 * @param string $previouspagelink
36308 * @param string $pagelink
36309 * @param string $more_file
36310 * @return string
36311 */
36312 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',
36313 $pagelink='%', $more_file='') {
36314 _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()');
36315
36316 $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');
36317 return wp_link_pages($args);
36318 }
36319
36320 /**
36321 * Get value based on option.
36322 *
36323 * @since 0.71
36324 * @deprecated Use get_option()
36325 * @see get_option()
36326 *
36327 * @param string $option
36328 * @return string
36329 */
36330 function get_settings($option) {
36331 _deprecated_function(__FUNCTION__, '0.0', 'get_option()');
36332
36333 return get_option($option);
36334 }
36335
36336 /**
36337 * Print the permalink of the current post in the loop.
36338 *
36339 * @since 0.71
36340 * @deprecated Use the_permalink()
36341 * @see the_permalink()
36342 */
36343 function permalink_link() {
36344 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()');
36345 the_permalink();
36346 }
36347
36348 /**
36349 * Print the permalink to the RSS feed.
36350 *
36351 * @since 0.71
36352 * @deprecated Use the_permalink_rss()
36353 * @see the_permalink_rss()
36354 *
36355 * @param string $file
36356 */
36357 function permalink_single_rss($deprecated = '') {
36358 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()');
36359 the_permalink_rss();
36360 }
36361
36362 /**
36363 * Gets the links associated with category.
36364 *
36365 * @see get_links() for argument information that can be used in $args
36366 * @since 1.0.1
36367 * @deprecated Use get_bookmarks()
36368 * @see get_bookmarks()
36369 *
36370 * @param string $args a query string
36371 * @return null|string
36372 */
36373 function wp_get_links($args = '') {
36374 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
36375
36376 if ( strpos( $args, '=' ) === false ) {
36377 $cat_id = $args;
36378 $args = add_query_arg( 'category', $cat_id, $args );
36379 }
36380
36381 $defaults = array(
36382 'category' => -1, 'before' => '',
36383 'after' => '<br />', 'between' => ' ',
36384 'show_images' => true, 'orderby' => 'name',
36385 'show_description' => true, 'show_rating' => false,
36386 'limit' => -1, 'show_updated' => true,
36387 'echo' => true
36388 );
36389
36390 $r = wp_parse_args( $args, $defaults );
36391 extract( $r, EXTR_SKIP );
36392
36393 return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo);
36394 }
36395
36396 /**
36397 * Gets the links associated with category by id.
36398 *
36399 * @since 0.71
36400 * @deprecated Use get_bookmarks()
36401 * @see get_bookmarks()
36402 *
36403 * @param int $category The category to use. If no category supplied uses all
36404 * @param string $before the html to output before the link
36405 * @param string $after the html to output after the link
36406 * @param string $between the html to output between the link/image and its description.
36407 * Not used if no image or show_images == true
36408 * @param bool $show_images whether to show images (if defined).
36409 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
36410 * 'description', or 'rating'. Or maybe owner. If you start the name with an
36411 * underscore the order will be reversed. You can also specify 'rand' as the order
36412 * which will return links in a random order.
36413 * @param bool $show_description whether to show the description if show_images=false/not defined.
36414 * @param bool $show_rating show rating stars/chars
36415 * @param int $limit Limit to X entries. If not specified, all entries are shown.
36416 * @param int $show_updated whether to show last updated timestamp
36417 * @param bool $echo whether to echo the results, or return them instead
36418 * @return null|string
36419 */
36420 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
36421 $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
36422 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
36423
36424 $order = 'ASC';
36425 if ( substr($orderby, 0, 1) == '_' ) {
36426 $order = 'DESC';
36427 $orderby = substr($orderby, 1);
36428 }
36429
36430 if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
36431 $category = '';
36432
36433 $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit");
36434
36435 if ( !$results )
36436 return;
36437
36438 $output = '';
36439
36440 foreach ( (array) $results as $row ) {
36441 if ( !isset($row->recently_updated) )
36442 $row->recently_updated = false;
36443 $output .= $before;
36444 if ( $show_updated && $row->recently_updated )
36445 $output .= get_option('links_recently_updated_prepend');
36446 $the_link = '#';
36447 if ( !empty($row->link_url) )
36448 $the_link = clean_url($row->link_url);
36449 $rel = $row->link_rel;
36450 if ( '' != $rel )
36451 $rel = ' rel="' . $rel . '"';
36452
36453 $desc = attribute_escape(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display'));
36454 $name = attribute_escape(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
36455 $title = $desc;
36456
36457 if ( $show_updated )
36458 if (substr($row->link_updated_f, 0, 2) != '00')
36459 $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';
36460
36461 if ( '' != $title )
36462 $title = ' title="' . $title . '"';
36463
36464 $alt = ' alt="' . $name . '"';
36465
36466 $target = $row->link_target;
36467 if ( '' != $target )
36468 $target = ' target="' . $target . '"';
36469
36470 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
36471
36472 if ( $row->link_image != null && $show_images ) {
36473 if ( strpos($row->link_image, 'http') !== false )
36474 $output .= "<img src=\"$row->link_image\" $alt $title />";
36475 else // If it's a relative path
36476 $output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
36477 } else {
36478 $output .= $name;
36479 }
36480
36481 $output .= '</a>';
36482
36483 if ( $show_updated && $row->recently_updated )
36484 $output .= get_option('links_recently_updated_append');
36485
36486 if ( $show_description && '' != $desc )
36487 $output .= $between . $desc;
36488
36489 if ($show_rating) {
36490 $output .= $between . get_linkrating($row);
36491 }
36492
36493 $output .= "$after\n";
36494 } // end while
36495
36496 if ( !$echo )
36497 return $output;
36498 echo $output;
36499 }
36500
36501 /**
36502 * Output entire list of links by category.
36503 *
36504 * Output a list of all links, listed by category, using the settings in
36505 * $wpdb->linkcategories and output it as a nested HTML unordered list.
36506 *
36507 * @author Dougal
36508 * @since 1.0.1
36509 * @deprecated Use wp_list_bookmarks()
36510 * @see wp_list_bookmarks()
36511 *
36512 * @param string $order Sort link categories by 'name' or 'id'
36513 * @param string $$deprecated Not Used
36514 */
36515 function get_links_list($order = 'name', $deprecated = '') {
36516 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
36517
36518 $order = strtolower($order);
36519
36520 // Handle link category sorting
36521 $direction = 'ASC';
36522 if ( '_' == substr($order,0,1) ) {
36523 $direction = 'DESC';
36524 $order = substr($order,1);
36525 }
36526
36527 if ( !isset($direction) )
36528 $direction = '';
36529
36530 $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0");
36531
36532 // Display each category
36533 if ( $cats ) {
36534 foreach ( (array) $cats as $cat ) {
36535 // Handle each category.
36536
36537 // Display the category name
36538 echo ' <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
36539 // Call get_links() with all the appropriate params
36540 get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
36541
36542 // Close the last category
36543 echo "\n\t</ul>\n</li>\n";
36544 }
36545 }
36546 }
36547
36548 /**
36549 * Show the link to the links popup and the number of links.
36550 *
36551 * @author Fullo
36552 * @link http://sprite.csr.unibo.it/fullo/
36553 *
36554 * @since 0.71
36555 * @deprecated {@internal Use function instead is unknown}}
36556 *
36557 * @param string $text the text of the link
36558 * @param int $width the width of the popup window
36559 * @param int $height the height of the popup window
36560 * @param string $file the page to open in the popup window
36561 * @param bool $count the number of links in the db
36562 */
36563 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
36564 _deprecated_function(__FUNCTION__, '0.0' );
36565
36566 if ( $count )
36567 $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links");
36568
36569 $javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">";
36570 $javascript .= $text;
36571
36572 if ( $count )
36573 $javascript .= " ($counts)";
36574
36575 $javascript .= "</a>\n\n";
36576 echo $javascript;
36577 }
36578
36579 /**
36580 * @since 1.0.1
36581 * @deprecated Use sanitize_bookmark_field()
36582 * @see sanitize_bookmark_field()
36583 *
36584 * @param object $link
36585 * @return unknown
36586 */
36587 function get_linkrating($link) {
36588 _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()');
36589 return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display');
36590 }
36591
36592 /**
36593 * Gets the name of category by id.
36594 *
36595 * @since 0.71
36596 * @deprecated Use get_category()
36597 * @see get_category()
36598 *
36599 * @param int $id The category to get. If no category supplied uses 0
36600 * @return string
36601 */
36602 function get_linkcatname($id = 0) {
36603 _deprecated_function(__FUNCTION__, '0.0', 'get_category()');
36604
36605 $id = (int) $id;
36606
36607 if ( empty($id) )
36608 return '';
36609
36610 $cats = wp_get_link_cats($id);
36611
36612 if ( empty($cats) || ! is_array($cats) )
36613 return '';
36614
36615 $cat_id = (int) $cats[0]; // Take the first cat.
36616
36617 $cat = get_category($cat_id);
36618 return $cat->name;
36619 }
36620
36621 /**
36622 * Print RSS comment feed link.
36623 *
36624 * @since 1.0.1
36625 * @deprecated Use post_comments_feed_link()
36626 * @see post_comments_feed_link()
36627 *
36628 * @param string $link_text
36629 * @param string $deprecated Not used
36630 */
36631 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') {
36632 _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()');
36633 post_comments_feed_link($link_text);
36634 }
36635
36636 /**
36637 * Print/Return link to category RSS2 feed.
36638 *
36639 * @since 1.2
36640 * @deprecated Use get_category_feed_link()
36641 * @see get_category_feed_link()
36642 *
36643 * @param bool $echo
36644 * @param int $cat_ID
36645 * @param string $deprecated Not used
36646 * @return string|null
36647 */
36648 function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') {
36649 _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()');
36650
36651 $link = get_category_feed_link($cat_ID, 'rss2');
36652
36653 if ( $echo )
36654 echo $link;
36655 return $link;
36656 }
36657
36658 /**
36659 * Print/Return link to author RSS feed.
36660 *
36661 * @since 1.2
36662 * @deprecated Use get_author_feed_link()
36663 * @see get_author_feed_link()
36664 *
36665 * @param bool $echo
36666 * @param int $author_id
36667 * @param string $deprecated Not used
36668 * @return string|null
36669 */
36670 function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') {
36671 _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()');
36672
36673 $link = get_author_feed_link($author_id);
36674 if ( $echo )
36675 echo $link;
36676 return $link;
36677 }
36678
36679 /**
36680 * Return link to the post RSS feed.
36681 *
36682 * @since 1.5
36683 * @deprecated Use get_post_comments_feed_link()
36684 * @see get_post_comments_feed_link()
36685 *
36686 * @param string $deprecated Not used
36687 * @return string
36688 */
36689 function comments_rss($deprecated = '') {
36690 _deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()');
36691 return get_post_comments_feed_link();
36692 }
36693
36694 /**
36695 * An alias of wp_create_user().
36696 *
36697 * @param string $username The user's username.
36698 * @param string $password The user's password.
36699 * @param string $email The user's email (optional).
36700 * @return int The new user's ID.
36701 * @deprecated Use wp_create_user()
36702 * @see wp_create_user()
36703 */
36704 function create_user($username, $password, $email) {
36705 _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' );
36706 return wp_create_user($username, $password, $email);
36707 }
36708
36709 /**
36710 * Unused Admin function.
36711 *
36712 * @since 2.0
36713 * @param string $deprecated Unknown
36714 * @deprecated 2.5
36715 */
36716 function documentation_link( $deprecated = '' ) {
36717 _deprecated_function( __FUNCTION__, '2.5', '' );
36718 return;
36719 }
36720
36721 /**
36722 * Unused function.
36723 *
36724 * @deprecated 2.5
36725 */
36726 function gzip_compression() {
36727 return false;
36728 }
36729
36730 /**
36731 * Retrieve an array of comment data about comment $comment_ID.
36732 *
36733 * @deprecated Use get_comment()
36734 * @see get_comment()
36735 * @since 0.71
36736 *
36737 * @uses $id
36738 * @uses $wpdb Database Object
36739 *
36740 * @param int $comment_ID The ID of the comment
36741 * @param int $no_cache Whether to use the cache or not (casted to bool)
36742 * @param bool $include_unapproved Whether to include unapproved comments or not
36743 * @return array The comment data
36744 */
36745 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) {
36746 _deprecated_function( __FUNCTION__, '2.7', 'get_comment()' );
36747 return get_comment($comment_ID, ARRAY_A);
36748 }
36749
36750 ?>