changeset 194 | 32102edaa81b |
parent 136 | bde1974c263b |
child 204 | 09a1c134465b |
193:2f6f6f7551ca | 194:32102edaa81b |
---|---|
1 <?php |
1 <?php |
2 /** |
2 /** |
3 * Deprecated functions from past WordPress versions. You shouldn't use these |
3 * Deprecated functions from past WordPress versions. You shouldn't use these |
4 * globals and functions and look for the alternatives instead. The functions |
4 * functions and look for the alternatives instead. The functions will be |
5 * and globals will be removed in a later version. |
5 * removed in a later version. |
6 * |
6 * |
7 * @package WordPress |
7 * @package WordPress |
8 * @subpackage Deprecated |
8 * @subpackage Deprecated |
9 */ |
9 */ |
10 |
10 |
11 /* |
11 /* |
12 * Deprecated global variables. |
|
13 */ |
|
14 |
|
15 /** |
|
16 * The name of the Posts table |
|
17 * @global string $tableposts |
|
18 * @deprecated Use $wpdb->posts |
|
19 */ |
|
20 $tableposts = $wpdb->posts; |
|
21 |
|
22 /** |
|
23 * The name of the Users table |
|
24 * @global string $tableusers |
|
25 * @deprecated Use $wpdb->users |
|
26 */ |
|
27 $tableusers = $wpdb->users; |
|
28 |
|
29 /** |
|
30 * The name of the Categories table |
|
31 * @global string $tablecategories |
|
32 * @deprecated Use $wpdb->categories |
|
33 */ |
|
34 $tablecategories = $wpdb->categories; |
|
35 |
|
36 /** |
|
37 * The name of the post to category table |
|
38 * @global string $tablepost2cat |
|
39 * @deprecated Use $wpdb->post2cat; |
|
40 */ |
|
41 $tablepost2cat = $wpdb->post2cat; |
|
42 |
|
43 /** |
|
44 * The name of the comments table |
|
45 * @global string $tablecomments |
|
46 * @deprecated Use $wpdb->comments; |
|
47 */ |
|
48 $tablecomments = $wpdb->comments; |
|
49 |
|
50 /** |
|
51 * The name of the links table |
|
52 * @global string $tablelinks |
|
53 * @deprecated Use $wpdb->links; |
|
54 */ |
|
55 $tablelinks = $wpdb->links; |
|
56 |
|
57 /** |
|
58 * @global string $tablelinkcategories |
|
59 * @deprecated Not used anymore; |
|
60 */ |
|
61 $tablelinkcategories = 'linkcategories_is_gone'; |
|
62 |
|
63 /** |
|
64 * The name of the options table |
|
65 * @global string $tableoptions |
|
66 * @deprecated Use $wpdb->options; |
|
67 */ |
|
68 $tableoptions = $wpdb->options; |
|
69 |
|
70 /** |
|
71 * The name of the postmeta table |
|
72 * @global string $tablepostmeta |
|
73 * @deprecated Use $wpdb->postmeta; |
|
74 */ |
|
75 $tablepostmeta = $wpdb->postmeta; |
|
76 |
|
77 /* |
|
78 * Deprecated functions come here to die. |
12 * Deprecated functions come here to die. |
79 */ |
13 */ |
80 |
14 |
81 /** |
15 /** |
82 * Entire Post data. |
16 * Entire Post data. |
83 * |
17 * |
84 * @since 0.71 |
18 * @since 0.71 |
19 * @deprecated 1.5.1 |
|
85 * @deprecated Use get_post() |
20 * @deprecated Use get_post() |
86 * @see get_post() |
21 * @see get_post() |
87 * |
22 * |
88 * @param int $postid |
23 * @param int $postid |
89 * @return array |
24 * @return array |
90 */ |
25 */ |
91 function get_postdata($postid) { |
26 function get_postdata($postid) { |
92 _deprecated_function(__FUNCTION__, '0.0', 'get_post()'); |
27 _deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' ); |
93 |
28 |
94 $post = &get_post($postid); |
29 $post = &get_post($postid); |
95 |
30 |
96 $postdata = array ( |
31 $postdata = array ( |
97 'ID' => $post->ID, |
32 'ID' => $post->ID, |
116 |
51 |
117 /** |
52 /** |
118 * Sets up the WordPress Loop. |
53 * Sets up the WordPress Loop. |
119 * |
54 * |
120 * @since 1.0.1 |
55 * @since 1.0.1 |
121 * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} |
56 * @deprecated 1.5 |
57 * @deprecated Use The Loop - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} |
|
122 */ |
58 */ |
123 function start_wp() { |
59 function start_wp() { |
124 global $wp_query, $post; |
60 global $wp_query, $post; |
125 |
61 |
126 _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') ); |
62 _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') ); |
127 |
63 |
128 // Since the old style loop is being used, advance the query iterator here. |
64 // Since the old style loop is being used, advance the query iterator here. |
129 $wp_query->next_post(); |
65 $wp_query->next_post(); |
130 |
66 |
131 setup_postdata($post); |
67 setup_postdata($post); |
133 |
69 |
134 /** |
70 /** |
135 * Return or Print Category ID. |
71 * Return or Print Category ID. |
136 * |
72 * |
137 * @since 0.71 |
73 * @since 0.71 |
74 * @deprecated 0.71 |
|
138 * @deprecated use get_the_category() |
75 * @deprecated use get_the_category() |
139 * @see get_the_category() |
76 * @see get_the_category() |
140 * |
77 * |
141 * @param bool $echo |
78 * @param bool $echo |
142 * @return null|int |
79 * @return null|int |
143 */ |
80 */ |
144 function the_category_ID($echo = true) { |
81 function the_category_ID($echo = true) { |
145 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()'); |
82 _deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' ); |
146 |
83 |
147 // Grab the first cat in the list. |
84 // Grab the first cat in the list. |
148 $categories = get_the_category(); |
85 $categories = get_the_category(); |
149 $cat = $categories[0]->term_id; |
86 $cat = $categories[0]->term_id; |
150 |
87 |
156 |
93 |
157 /** |
94 /** |
158 * Print category with optional text before and after. |
95 * Print category with optional text before and after. |
159 * |
96 * |
160 * @since 0.71 |
97 * @since 0.71 |
98 * @deprecated 0.71 |
|
161 * @deprecated use get_the_category_by_ID() |
99 * @deprecated use get_the_category_by_ID() |
162 * @see get_the_category_by_ID() |
100 * @see get_the_category_by_ID() |
163 * |
101 * |
164 * @param string $before |
102 * @param string $before |
165 * @param string $after |
103 * @param string $after |
166 */ |
104 */ |
167 function the_category_head($before='', $after='') { |
105 function the_category_head($before='', $after='') { |
168 global $currentcat, $previouscat; |
106 global $currentcat, $previouscat; |
169 |
107 |
170 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()'); |
108 _deprecated_function( __FUNCTION__, '0.71', 'get_the_category_by_ID()' ); |
171 |
109 |
172 // Grab the first cat in the list. |
110 // Grab the first cat in the list. |
173 $categories = get_the_category(); |
111 $categories = get_the_category(); |
174 $currentcat = $categories[0]->category_id; |
112 $currentcat = $categories[0]->category_id; |
175 if ( $currentcat != $previouscat ) { |
113 if ( $currentcat != $previouscat ) { |
182 |
120 |
183 /** |
121 /** |
184 * Prints link to the previous post. |
122 * Prints link to the previous post. |
185 * |
123 * |
186 * @since 1.5 |
124 * @since 1.5 |
125 * @deprecated 2.0 |
|
187 * @deprecated Use previous_post_link() |
126 * @deprecated Use previous_post_link() |
188 * @see previous_post_link() |
127 * @see previous_post_link() |
189 * |
128 * |
190 * @param string $format |
129 * @param string $format |
191 * @param string $previous |
130 * @param string $previous |
194 * @param int $limitprev |
133 * @param int $limitprev |
195 * @param string $excluded_categories |
134 * @param string $excluded_categories |
196 */ |
135 */ |
197 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { |
136 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { |
198 |
137 |
199 _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()'); |
138 _deprecated_function( __FUNCTION__, '2.0', 'previous_post_link()' ); |
200 |
139 |
201 if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
140 if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
202 $in_same_cat = false; |
141 $in_same_cat = false; |
203 else |
142 else |
204 $in_same_cat = true; |
143 $in_same_cat = true; |
208 if ( !$post ) |
147 if ( !$post ) |
209 return; |
148 return; |
210 |
149 |
211 $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
150 $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
212 if ( 'yes' == $title ) |
151 if ( 'yes' == $title ) |
213 $string .= apply_filters('the_title', $post->post_title, $post); |
152 $string .= apply_filters('the_title', $post->post_title, $post->ID); |
214 $string .= '</a>'; |
153 $string .= '</a>'; |
215 $format = str_replace('%', $string, $format); |
154 $format = str_replace('%', $string, $format); |
216 echo $format; |
155 echo $format; |
217 } |
156 } |
218 |
157 |
219 /** |
158 /** |
220 * Prints link to the next post. |
159 * Prints link to the next post. |
221 * |
160 * |
222 * @since 0.71 |
161 * @since 0.71 |
162 * @deprecated 2.0 |
|
223 * @deprecated Use next_post_link() |
163 * @deprecated Use next_post_link() |
224 * @see next_post_link() |
164 * @see next_post_link() |
225 * |
165 * |
226 * @param string $format |
166 * @param string $format |
227 * @param string $previous |
167 * @param string $next |
228 * @param string $title |
168 * @param string $title |
229 * @param string $in_same_cat |
169 * @param string $in_same_cat |
230 * @param int $limitprev |
170 * @param int $limitnext |
231 * @param string $excluded_categories |
171 * @param string $excluded_categories |
232 */ |
172 */ |
233 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { |
173 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { |
234 _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()'); |
174 _deprecated_function( __FUNCTION__, '2.0', 'next_post_link()' ); |
235 |
175 |
236 if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
176 if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
237 $in_same_cat = false; |
177 $in_same_cat = false; |
238 else |
178 else |
239 $in_same_cat = true; |
179 $in_same_cat = true; |
243 if ( !$post ) |
183 if ( !$post ) |
244 return; |
184 return; |
245 |
185 |
246 $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
186 $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
247 if ( 'yes' == $title ) |
187 if ( 'yes' == $title ) |
248 $string .= apply_filters('the_title', $post->post_title, $nextpost); |
188 $string .= apply_filters('the_title', $post->post_title, $post->ID); |
249 $string .= '</a>'; |
189 $string .= '</a>'; |
250 $format = str_replace('%', $string, $format); |
190 $format = str_replace('%', $string, $format); |
251 echo $format; |
191 echo $format; |
252 } |
192 } |
253 |
193 |
254 /** |
194 /** |
255 * Whether user can create a post. |
195 * Whether user can create a post. |
256 * |
196 * |
257 * @since 1.5 |
197 * @since 1.5 |
198 * @deprecated 2.0 |
|
258 * @deprecated Use current_user_can() |
199 * @deprecated Use current_user_can() |
259 * @see current_user_can() |
200 * @see current_user_can() |
260 * |
201 * |
261 * @param int $user_id |
202 * @param int $user_id |
262 * @param int $blog_id Not Used |
203 * @param int $blog_id Not Used |
263 * @param int $category_id Not Used |
204 * @param int $category_id Not Used |
264 * @return bool |
205 * @return bool |
265 */ |
206 */ |
266 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { |
207 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { |
267 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
208 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
268 |
209 |
269 $author_data = get_userdata($user_id); |
210 $author_data = get_userdata($user_id); |
270 return ($author_data->user_level > 1); |
211 return ($author_data->user_level > 1); |
271 } |
212 } |
272 |
213 |
273 /** |
214 /** |
274 * Whether user can create a post. |
215 * Whether user can create a post. |
275 * |
216 * |
276 * @since 1.5 |
217 * @since 1.5 |
218 * @deprecated 2.0 |
|
277 * @deprecated Use current_user_can() |
219 * @deprecated Use current_user_can() |
278 * @see current_user_can() |
220 * @see current_user_can() |
279 * |
221 * |
280 * @param int $user_id |
222 * @param int $user_id |
281 * @param int $blog_id Not Used |
223 * @param int $blog_id Not Used |
282 * @param int $category_id Not Used |
224 * @param int $category_id Not Used |
283 * @return bool |
225 * @return bool |
284 */ |
226 */ |
285 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { |
227 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { |
286 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
228 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
287 |
229 |
288 $author_data = get_userdata($user_id); |
230 $author_data = get_userdata($user_id); |
289 return ($author_data->user_level >= 1); |
231 return ($author_data->user_level >= 1); |
290 } |
232 } |
291 |
233 |
292 /** |
234 /** |
293 * Whether user can edit a post. |
235 * Whether user can edit a post. |
294 * |
236 * |
295 * @since 1.5 |
237 * @since 1.5 |
238 * @deprecated 2.0 |
|
296 * @deprecated Use current_user_can() |
239 * @deprecated Use current_user_can() |
297 * @see current_user_can() |
240 * @see current_user_can() |
298 * |
241 * |
299 * @param int $user_id |
242 * @param int $user_id |
300 * @param int $post_id |
243 * @param int $post_id |
301 * @param int $blog_id Not Used |
244 * @param int $blog_id Not Used |
302 * @return bool |
245 * @return bool |
303 */ |
246 */ |
304 function user_can_edit_post($user_id, $post_id, $blog_id = 1) { |
247 function user_can_edit_post($user_id, $post_id, $blog_id = 1) { |
305 _deprecated_function(__FUNCTION__, '0', 'current_user_can()'); |
248 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
306 |
249 |
307 $author_data = get_userdata($user_id); |
250 $author_data = get_userdata($user_id); |
308 $post = get_post($post_id); |
251 $post = get_post($post_id); |
309 $post_author_data = get_userdata($post->post_author); |
252 $post_author_data = get_userdata($post->post_author); |
310 |
253 |
311 if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) |
254 if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) |
312 || ($author_data->user_level > $post_author_data->user_level) |
255 || ($author_data->user_level > $post_author_data->user_level) |
313 || ($author_data->user_level >= 10) ) { |
256 || ($author_data->user_level >= 10) ) { |
314 return true; |
257 return true; |
315 } else { |
258 } else { |
316 return false; |
259 return false; |
319 |
262 |
320 /** |
263 /** |
321 * Whether user can delete a post. |
264 * Whether user can delete a post. |
322 * |
265 * |
323 * @since 1.5 |
266 * @since 1.5 |
267 * @deprecated 2.0 |
|
324 * @deprecated Use current_user_can() |
268 * @deprecated Use current_user_can() |
325 * @see current_user_can() |
269 * @see current_user_can() |
326 * |
270 * |
327 * @param int $user_id |
271 * @param int $user_id |
328 * @param int $post_id |
272 * @param int $post_id |
329 * @param int $blog_id Not Used |
273 * @param int $blog_id Not Used |
330 * @return bool |
274 * @return bool |
331 */ |
275 */ |
332 function user_can_delete_post($user_id, $post_id, $blog_id = 1) { |
276 function user_can_delete_post($user_id, $post_id, $blog_id = 1) { |
333 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
277 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
334 |
278 |
335 // right now if one can edit, one can delete |
279 // right now if one can edit, one can delete |
336 return user_can_edit_post($user_id, $post_id, $blog_id); |
280 return user_can_edit_post($user_id, $post_id, $blog_id); |
337 } |
281 } |
338 |
282 |
339 /** |
283 /** |
340 * Whether user can set new posts' dates. |
284 * Whether user can set new posts' dates. |
341 * |
285 * |
342 * @since 1.5 |
286 * @since 1.5 |
287 * @deprecated 2.0 |
|
343 * @deprecated Use current_user_can() |
288 * @deprecated Use current_user_can() |
344 * @see current_user_can() |
289 * @see current_user_can() |
345 * |
290 * |
346 * @param int $user_id |
291 * @param int $user_id |
347 * @param int $blog_id Not Used |
292 * @param int $blog_id Not Used |
348 * @param int $category_id Not Used |
293 * @param int $category_id Not Used |
349 * @return bool |
294 * @return bool |
350 */ |
295 */ |
351 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { |
296 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { |
352 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
297 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
353 |
298 |
354 $author_data = get_userdata($user_id); |
299 $author_data = get_userdata($user_id); |
355 return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); |
300 return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); |
356 } |
301 } |
357 |
302 |
358 /** |
303 /** |
359 * Whether user can delete a post. |
304 * Whether user can delete a post. |
360 * |
305 * |
361 * @since 1.5 |
306 * @since 1.5 |
307 * @deprecated 2.0 |
|
362 * @deprecated Use current_user_can() |
308 * @deprecated Use current_user_can() |
363 * @see current_user_can() |
309 * @see current_user_can() |
364 * |
310 * |
365 * @param int $user_id |
311 * @param int $user_id |
366 * @param int $post_id |
312 * @param int $post_id |
367 * @param int $blog_id Not Used |
313 * @param int $blog_id Not Used |
368 * @return bool returns true if $user_id can edit $post_id's date |
314 * @return bool returns true if $user_id can edit $post_id's date |
369 */ |
315 */ |
370 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { |
316 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { |
371 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
317 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
372 |
318 |
373 $author_data = get_userdata($user_id); |
319 $author_data = get_userdata($user_id); |
374 return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); |
320 return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); |
375 } |
321 } |
376 |
322 |
377 /** |
323 /** |
378 * Whether user can delete a post. |
324 * Whether user can delete a post. |
379 * |
325 * |
380 * @since 1.5 |
326 * @since 1.5 |
327 * @deprecated 2.0 |
|
381 * @deprecated Use current_user_can() |
328 * @deprecated Use current_user_can() |
382 * @see current_user_can() |
329 * @see current_user_can() |
383 * |
330 * |
384 * @param int $user_id |
331 * @param int $user_id |
385 * @param int $post_id |
332 * @param int $post_id |
386 * @param int $blog_id Not Used |
333 * @param int $blog_id Not Used |
387 * @return bool returns true if $user_id can edit $post_id's comments |
334 * @return bool returns true if $user_id can edit $post_id's comments |
388 */ |
335 */ |
389 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { |
336 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { |
390 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
337 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
391 |
338 |
392 // right now if one can edit a post, one can edit comments made on it |
339 // right now if one can edit a post, one can edit comments made on it |
393 return user_can_edit_post($user_id, $post_id, $blog_id); |
340 return user_can_edit_post($user_id, $post_id, $blog_id); |
394 } |
341 } |
395 |
342 |
396 /** |
343 /** |
397 * Whether user can delete a post. |
344 * Whether user can delete a post. |
398 * |
345 * |
399 * @since 1.5 |
346 * @since 1.5 |
347 * @deprecated 2.0 |
|
400 * @deprecated Use current_user_can() |
348 * @deprecated Use current_user_can() |
401 * @see current_user_can() |
349 * @see current_user_can() |
402 * |
350 * |
403 * @param int $user_id |
351 * @param int $user_id |
404 * @param int $post_id |
352 * @param int $post_id |
405 * @param int $blog_id Not Used |
353 * @param int $blog_id Not Used |
406 * @return bool returns true if $user_id can delete $post_id's comments |
354 * @return bool returns true if $user_id can delete $post_id's comments |
407 */ |
355 */ |
408 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { |
356 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { |
409 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
357 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
410 |
358 |
411 // right now if one can edit comments, one can delete comments |
359 // right now if one can edit comments, one can delete comments |
412 return user_can_edit_post_comments($user_id, $post_id, $blog_id); |
360 return user_can_edit_post_comments($user_id, $post_id, $blog_id); |
413 } |
361 } |
414 |
362 |
415 /** |
363 /** |
416 * Can user can edit other user. |
364 * Can user can edit other user. |
417 * |
365 * |
418 * @since 1.5 |
366 * @since 1.5 |
367 * @deprecated 2.0 |
|
419 * @deprecated Use current_user_can() |
368 * @deprecated Use current_user_can() |
420 * @see current_user_can() |
369 * @see current_user_can() |
421 * |
370 * |
422 * @param int $user_id |
371 * @param int $user_id |
423 * @param int $other_user |
372 * @param int $other_user |
424 * @return bool |
373 * @return bool |
425 */ |
374 */ |
426 function user_can_edit_user($user_id, $other_user) { |
375 function user_can_edit_user($user_id, $other_user) { |
427 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); |
376 _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); |
428 |
377 |
429 $user = get_userdata($user_id); |
378 $user = get_userdata($user_id); |
430 $other = get_userdata($other_user); |
379 $other = get_userdata($other_user); |
431 if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) |
380 if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) |
432 return true; |
381 return true; |
436 |
385 |
437 /** |
386 /** |
438 * Gets the links associated with category $cat_name. |
387 * Gets the links associated with category $cat_name. |
439 * |
388 * |
440 * @since 0.71 |
389 * @since 0.71 |
441 * @deprecated Use get_links() |
390 * @deprecated 2.1 |
442 * @see get_links() |
391 * @deprecated Use get_bookmarks() |
392 * @see get_bookmarks() |
|
443 * |
393 * |
444 * @param string $cat_name Optional. The category name to use. If no match is found uses all. |
394 * @param string $cat_name Optional. The category name to use. If no match is found uses all. |
445 * @param string $before Optional. The html to output before the link. |
395 * @param string $before Optional. The html to output before the link. |
446 * @param string $after Optional. The html to output after the link. |
396 * @param string $after Optional. The html to output after the link. |
447 * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true. |
397 * @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. |
455 * @param int $show_updated Optional. Whether to show last updated timestamp |
405 * @param int $show_updated Optional. Whether to show last updated timestamp |
456 */ |
406 */ |
457 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', |
407 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', |
458 $show_description = true, $show_rating = false, |
408 $show_description = true, $show_rating = false, |
459 $limit = -1, $show_updated = 0) { |
409 $limit = -1, $show_updated = 0) { |
460 _deprecated_function(__FUNCTION__, '0.0', 'get_links()'); |
410 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
461 |
411 |
462 $cat_id = -1; |
412 $cat_id = -1; |
463 $cat = get_term_by('name', $cat_name, 'link_category'); |
413 $cat = get_term_by('name', $cat_name, 'link_category'); |
464 if ( $cat ) |
414 if ( $cat ) |
465 $cat_id = $cat->term_id; |
415 $cat_id = $cat->term_id; |
469 |
419 |
470 /** |
420 /** |
471 * Gets the links associated with the named category. |
421 * Gets the links associated with the named category. |
472 * |
422 * |
473 * @since 1.0.1 |
423 * @since 1.0.1 |
474 * @deprecated Use wp_get_links() |
424 * @deprecated 2.1 |
475 * @see wp_get_links() |
425 * @deprecated Use wp_list_bookmarks() |
426 * @see wp_list_bookmarks() |
|
476 * |
427 * |
477 * @param string $category The category to use. |
428 * @param string $category The category to use. |
478 * @param string $args |
429 * @param string $args |
479 * @return bool|null |
430 * @return bool|null |
480 */ |
431 */ |
481 function wp_get_linksbyname($category, $args = '') { |
432 function wp_get_linksbyname($category, $args = '') { |
482 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); |
433 _deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()'); |
483 |
434 |
484 $cat = get_term_by('name', $category, 'link_category'); |
435 $defaults = array( |
485 if ( !$cat ) |
436 'after' => '<br />', |
486 return false; |
437 'before' => '', |
487 $cat_id = $cat->term_id; |
438 'categorize' => 0, |
488 |
439 'category_after' => '', |
489 $args = add_query_arg('category', $cat_id, $args); |
440 'category_before' => '', |
490 wp_get_links($args); |
441 'category_name' => $category, |
442 'show_description' => 1, |
|
443 'title_li' => '', |
|
444 ); |
|
445 |
|
446 $r = wp_parse_args( $args, $defaults ); |
|
447 |
|
448 return wp_list_bookmarks($r); |
|
491 } |
449 } |
492 |
450 |
493 /** |
451 /** |
494 * Gets an array of link objects associated with category $cat_name. |
452 * Gets an array of link objects associated with category $cat_name. |
495 * |
453 * |
499 * echo '<li>'.$link->link_name.'</li>'; |
457 * echo '<li>'.$link->link_name.'</li>'; |
500 * } |
458 * } |
501 * </code> |
459 * </code> |
502 * |
460 * |
503 * @since 1.0.1 |
461 * @since 1.0.1 |
504 * @deprecated Use get_linkobjects() |
462 * @deprecated 2.1 |
505 * @see get_linkobjects() |
463 * @deprecated Use get_bookmarks() |
464 * @see get_bookmarks() |
|
506 * |
465 * |
507 * @param string $cat_name The category name to use. If no match is found uses all. |
466 * @param string $cat_name The category name to use. If no match is found uses all. |
508 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. |
467 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. |
509 * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also |
468 * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also |
510 * specify 'rand' as the order which will return links in a random order. |
469 * specify 'rand' as the order which will return links in a random order. |
511 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
470 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
512 * @return unknown |
471 * @return unknown |
513 */ |
472 */ |
514 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { |
473 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { |
515 _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()'); |
474 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
516 |
475 |
517 $cat_id = -1; |
476 $cat_id = -1; |
518 $cat = get_term_by('name', $cat_name, 'link_category'); |
477 $cat = get_term_by('name', $cat_name, 'link_category'); |
519 if ( $cat ) |
478 if ( $cat ) |
520 $cat_id = $cat->term_id; |
479 $cat_id = $cat->term_id; |
551 * <li>link_rel</li> |
510 * <li>link_rel</li> |
552 * <li>link_notes</li> |
511 * <li>link_notes</li> |
553 * </ol> |
512 * </ol> |
554 * |
513 * |
555 * @since 1.0.1 |
514 * @since 1.0.1 |
515 * @deprecated 2.1 |
|
556 * @deprecated Use get_bookmarks() |
516 * @deprecated Use get_bookmarks() |
557 * @see get_bookmarks() |
517 * @see get_bookmarks() |
558 * |
518 * |
559 * @param int $category The category to use. If no category supplied uses all |
519 * @param int $category The category to use. If no category supplied uses all |
560 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', |
520 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', |
563 * order which will return links in a random order. |
523 * order which will return links in a random order. |
564 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
524 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
565 * @return unknown |
525 * @return unknown |
566 */ |
526 */ |
567 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { |
527 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { |
568 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); |
528 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
569 |
529 |
570 $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); |
530 $links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ; |
571 |
531 |
572 $links_array = array(); |
532 $links_array = array(); |
573 foreach ($links as $link) |
533 foreach ($links as $link) |
574 $links_array[] = $link; |
534 $links_array[] = $link; |
575 |
535 |
578 |
538 |
579 /** |
539 /** |
580 * Gets the links associated with category 'cat_name' and display rating stars/chars. |
540 * Gets the links associated with category 'cat_name' and display rating stars/chars. |
581 * |
541 * |
582 * @since 0.71 |
542 * @since 0.71 |
543 * @deprecated 2.1 |
|
583 * @deprecated Use get_bookmarks() |
544 * @deprecated Use get_bookmarks() |
584 * @see get_bookmarks() |
545 * @see get_bookmarks() |
585 * |
546 * |
586 * @param string $cat_name The category name to use. If no match is found uses all |
547 * @param string $cat_name The category name to use. If no match is found uses all |
587 * @param string $before The html to output before the link |
548 * @param string $before The html to output before the link |
596 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
557 * @param int $limit Limit to X entries. If not specified, all entries are shown. |
597 * @param int $show_updated Whether to show last updated timestamp |
558 * @param int $show_updated Whether to show last updated timestamp |
598 */ |
559 */ |
599 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ", |
560 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ", |
600 $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { |
561 $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { |
601 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); |
562 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
602 |
563 |
603 get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); |
564 get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); |
604 } |
565 } |
605 |
566 |
606 /** |
567 /** |
607 * Gets the links associated with category n and display rating stars/chars. |
568 * Gets the links associated with category n and display rating stars/chars. |
608 * |
569 * |
609 * @since 0.71 |
570 * @since 0.71 |
571 * @deprecated 2.1 |
|
610 * @deprecated Use get_bookmarks() |
572 * @deprecated Use get_bookmarks() |
611 * @see get_bookmarks() |
573 * @see get_bookmarks() |
612 * |
574 * |
613 * @param int $category The category to use. If no category supplied uses all |
575 * @param int $category The category to use. If no category supplied uses all |
614 * @param string $before The html to output before the link |
576 * @param string $before The html to output before the link |
623 * @param string $limit Limit to X entries. If not specified, all entries are shown. |
585 * @param string $limit Limit to X entries. If not specified, all entries are shown. |
624 * @param int $show_updated Whether to show last updated timestamp |
586 * @param int $show_updated Whether to show last updated timestamp |
625 */ |
587 */ |
626 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, |
588 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, |
627 $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { |
589 $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { |
628 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); |
590 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
629 |
591 |
630 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); |
592 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); |
631 } |
593 } |
632 |
594 |
633 /** |
595 /** |
634 * Gets the auto_toggle setting. |
596 * Gets the auto_toggle setting. |
635 * |
597 * |
636 * @since 0.71 |
598 * @since 0.71 |
599 * @deprecated 2.1 |
|
637 * @deprecated No alternative function available |
600 * @deprecated No alternative function available |
638 * |
601 * |
639 * @param int $id The category to get. If no category supplied uses 0 |
602 * @param int $id The category to get. If no category supplied uses 0 |
640 * @return int Only returns 0. |
603 * @return int Only returns 0. |
641 */ |
604 */ |
642 function get_autotoggle($id = 0) { |
605 function get_autotoggle($id = 0) { |
643 _deprecated_function(__FUNCTION__, '0.0' ); |
606 _deprecated_function( __FUNCTION__, '2.1' ); |
644 return 0; |
607 return 0; |
645 } |
608 } |
646 |
609 |
647 /** |
610 /** |
648 * @since 0.71 |
611 * @since 0.71 |
612 * @deprecated 2.1 |
|
649 * @deprecated Use wp_list_categories() |
613 * @deprecated Use wp_list_categories() |
650 * @see wp_list_categories() |
614 * @see wp_list_categories() |
651 * |
615 * |
652 * @param int $optionall |
616 * @param int $optionall |
653 * @param string $all |
617 * @param string $all |
670 * @return unknown |
634 * @return unknown |
671 */ |
635 */ |
672 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, |
636 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, |
673 $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, |
637 $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, |
674 $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { |
638 $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { |
675 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); |
639 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); |
676 |
640 |
677 $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', |
641 $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', |
678 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); |
642 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); |
679 return wp_list_cats($query); |
643 return wp_list_cats($query); |
680 } |
644 } |
681 |
645 |
682 /** |
646 /** |
683 * @since 1.2 |
647 * @since 1.2 |
648 * @deprecated 2.1 |
|
684 * @deprecated Use wp_list_categories() |
649 * @deprecated Use wp_list_categories() |
685 * @see wp_list_categories() |
650 * @see wp_list_categories() |
686 * |
651 * |
687 * @param string|array $args |
652 * @param string|array $args |
688 * @return unknown |
653 * @return unknown |
689 */ |
654 */ |
690 function wp_list_cats($args = '') { |
655 function wp_list_cats($args = '') { |
691 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); |
656 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); |
692 |
657 |
693 $r = wp_parse_args( $args ); |
658 $r = wp_parse_args( $args ); |
694 |
659 |
695 // Map to new names. |
660 // Map to new names. |
696 if ( isset($r['optionall']) && isset($r['all'])) |
661 if ( isset($r['optionall']) && isset($r['all'])) |
710 return wp_list_categories($r); |
675 return wp_list_categories($r); |
711 } |
676 } |
712 |
677 |
713 /** |
678 /** |
714 * @since 0.71 |
679 * @since 0.71 |
680 * @deprecated 2.1 |
|
715 * @deprecated Use wp_dropdown_categories() |
681 * @deprecated Use wp_dropdown_categories() |
716 * @see wp_dropdown_categories() |
682 * @see wp_dropdown_categories() |
717 * |
683 * |
718 * @param int $optionall |
684 * @param int $optionall |
719 * @param string $all |
685 * @param string $all |
728 * @return unknown |
694 * @return unknown |
729 */ |
695 */ |
730 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', |
696 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', |
731 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, |
697 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, |
732 $selected = 0, $exclude = 0) { |
698 $selected = 0, $exclude = 0) { |
733 _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()'); |
699 _deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' ); |
734 |
700 |
735 $show_option_all = ''; |
701 $show_option_all = ''; |
736 if ( $optionall ) |
702 if ( $optionall ) |
737 $show_option_all = $all; |
703 $show_option_all = $all; |
738 |
704 |
745 $query = add_query_arg($vars, ''); |
711 $query = add_query_arg($vars, ''); |
746 return wp_dropdown_categories($query); |
712 return wp_dropdown_categories($query); |
747 } |
713 } |
748 |
714 |
749 /** |
715 /** |
750 * @since 2.1 |
|
751 * @deprecated Use wp_tiny_mce(). |
|
752 * @see wp_tiny_mce() |
|
753 */ |
|
754 function tinymce_include() { |
|
755 _deprecated_function(__FUNCTION__, '0.0', 'wp_tiny_mce()'); |
|
756 |
|
757 wp_tiny_mce(); |
|
758 } |
|
759 |
|
760 /** |
|
761 * @since 1.2 |
716 * @since 1.2 |
717 * @deprecated 2.1 |
|
762 * @deprecated Use wp_list_authors() |
718 * @deprecated Use wp_list_authors() |
763 * @see wp_list_authors() |
719 * @see wp_list_authors() |
764 * |
720 * |
765 * @param bool $optioncount |
721 * @param bool $optioncount |
766 * @param bool $exclude_admin |
722 * @param bool $exclude_admin |
769 * @param string $feed |
725 * @param string $feed |
770 * @param string $feed_image |
726 * @param string $feed_image |
771 * @return unknown |
727 * @return unknown |
772 */ |
728 */ |
773 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { |
729 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { |
774 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()'); |
730 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_authors()' ); |
775 |
731 |
776 $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); |
732 $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); |
777 return wp_list_authors($args); |
733 return wp_list_authors($args); |
778 } |
734 } |
779 |
735 |
780 /** |
736 /** |
781 * @since 1.0.1 |
737 * @since 1.0.1 |
738 * @deprecated 2.1 |
|
782 * @deprecated Use wp_get_post_categories() |
739 * @deprecated Use wp_get_post_categories() |
783 * @see wp_get_post_categories() |
740 * @see wp_get_post_categories() |
784 * |
741 * |
785 * @param int $blogid Not Used |
742 * @param int $blogid Not Used |
786 * @param int $post_ID |
743 * @param int $post_ID |
787 * @return unknown |
744 * @return unknown |
788 */ |
745 */ |
789 function wp_get_post_cats($blogid = '1', $post_ID = 0) { |
746 function wp_get_post_cats($blogid = '1', $post_ID = 0) { |
790 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()'); |
747 _deprecated_function( __FUNCTION__, '2.1', 'wp_get_post_categories()' ); |
791 return wp_get_post_categories($post_ID); |
748 return wp_get_post_categories($post_ID); |
792 } |
749 } |
793 |
750 |
794 /** |
751 /** |
795 * Sets the categories that the post id belongs to. |
752 * Sets the categories that the post id belongs to. |
796 * |
753 * |
797 * @since 1.0.1 |
754 * @since 1.0.1 |
755 * @deprecated 2.1 |
|
798 * @deprecated Use wp_set_post_categories() |
756 * @deprecated Use wp_set_post_categories() |
799 * @see wp_set_post_categories() |
757 * @see wp_set_post_categories() |
800 * |
758 * |
801 * @param int $blogid Not used |
759 * @param int $blogid Not used |
802 * @param int $post_ID |
760 * @param int $post_ID |
803 * @param array $post_categories |
761 * @param array $post_categories |
804 * @return unknown |
762 * @return unknown |
805 */ |
763 */ |
806 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { |
764 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { |
807 _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()'); |
765 _deprecated_function( __FUNCTION__, '2.1', 'wp_set_post_categories()' ); |
808 return wp_set_post_categories($post_ID, $post_categories); |
766 return wp_set_post_categories($post_ID, $post_categories); |
809 } |
767 } |
810 |
768 |
811 /** |
769 /** |
812 * @since 0.71 |
770 * @since 0.71 |
771 * @deprecated 2.1 |
|
813 * @deprecated Use wp_get_archives() |
772 * @deprecated Use wp_get_archives() |
814 * @see wp_get_archives() |
773 * @see wp_get_archives() |
815 * |
774 * |
816 * @param string $type |
775 * @param string $type |
817 * @param string $limit |
776 * @param string $limit |
820 * @param string $after |
779 * @param string $after |
821 * @param bool $show_post_count |
780 * @param bool $show_post_count |
822 * @return unknown |
781 * @return unknown |
823 */ |
782 */ |
824 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { |
783 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { |
825 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()'); |
784 _deprecated_function( __FUNCTION__, '2.1', 'wp_get_archives()' ); |
826 $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); |
785 $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); |
827 return wp_get_archives($args); |
786 return wp_get_archives($args); |
828 } |
787 } |
829 |
788 |
830 /** |
789 /** |
831 * Returns or Prints link to the author's posts. |
790 * Returns or Prints link to the author's posts. |
832 * |
791 * |
833 * @since 1.2 |
792 * @since 1.2 |
793 * @deprecated 2.1 |
|
834 * @deprecated Use get_author_posts_url() |
794 * @deprecated Use get_author_posts_url() |
835 * @see get_author_posts_url() |
795 * @see get_author_posts_url() |
836 * |
796 * |
837 * @param bool $echo Optional. |
797 * @param bool $echo Optional. |
838 * @param int $author_id Required. |
798 * @param int $author_id Required. |
839 * @param string $author_nicename Optional. |
799 * @param string $author_nicename Optional. |
840 * @return string|null |
800 * @return string|null |
841 */ |
801 */ |
842 function get_author_link($echo = false, $author_id, $author_nicename = '') { |
802 function get_author_link($echo = false, $author_id, $author_nicename = '') { |
843 _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()'); |
803 _deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' ); |
844 |
804 |
845 $link = get_author_posts_url($author_id, $author_nicename); |
805 $link = get_author_posts_url($author_id, $author_nicename); |
846 |
806 |
847 if ( $echo ) |
807 if ( $echo ) |
848 echo $link; |
808 echo $link; |
851 |
811 |
852 /** |
812 /** |
853 * Print list of pages based on arguments. |
813 * Print list of pages based on arguments. |
854 * |
814 * |
855 * @since 0.71 |
815 * @since 0.71 |
816 * @deprecated 2.1 |
|
856 * @deprecated Use wp_link_pages() |
817 * @deprecated Use wp_link_pages() |
857 * @see wp_link_pages() |
818 * @see wp_link_pages() |
858 * |
819 * |
859 * @param string $before |
820 * @param string $before |
860 * @param string $after |
821 * @param string $after |
865 * @param string $more_file |
826 * @param string $more_file |
866 * @return string |
827 * @return string |
867 */ |
828 */ |
868 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', |
829 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', |
869 $pagelink='%', $more_file='') { |
830 $pagelink='%', $more_file='') { |
870 _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()'); |
831 _deprecated_function( __FUNCTION__, '2.1', 'wp_link_pages()' ); |
871 |
832 |
872 $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); |
833 $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); |
873 return wp_link_pages($args); |
834 return wp_link_pages($args); |
874 } |
835 } |
875 |
836 |
876 /** |
837 /** |
877 * Get value based on option. |
838 * Get value based on option. |
878 * |
839 * |
879 * @since 0.71 |
840 * @since 0.71 |
841 * @deprecated 2.1 |
|
880 * @deprecated Use get_option() |
842 * @deprecated Use get_option() |
881 * @see get_option() |
843 * @see get_option() |
882 * |
844 * |
883 * @param string $option |
845 * @param string $option |
884 * @return string |
846 * @return string |
885 */ |
847 */ |
886 function get_settings($option) { |
848 function get_settings($option) { |
887 _deprecated_function(__FUNCTION__, '0.0', 'get_option()'); |
849 _deprecated_function( __FUNCTION__, '2.1', 'get_option()' ); |
888 |
850 |
889 return get_option($option); |
851 return get_option($option); |
890 } |
852 } |
891 |
853 |
892 /** |
854 /** |
893 * Print the permalink of the current post in the loop. |
855 * Print the permalink of the current post in the loop. |
894 * |
856 * |
895 * @since 0.71 |
857 * @since 0.71 |
858 * @deprecated 1.2 |
|
896 * @deprecated Use the_permalink() |
859 * @deprecated Use the_permalink() |
897 * @see the_permalink() |
860 * @see the_permalink() |
898 */ |
861 */ |
899 function permalink_link() { |
862 function permalink_link() { |
900 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()'); |
863 _deprecated_function( __FUNCTION__, '1.2', 'the_permalink()' ); |
901 the_permalink(); |
864 the_permalink(); |
902 } |
865 } |
903 |
866 |
904 /** |
867 /** |
905 * Print the permalink to the RSS feed. |
868 * Print the permalink to the RSS feed. |
906 * |
869 * |
907 * @since 0.71 |
870 * @since 0.71 |
871 * @deprecated 2.3 |
|
908 * @deprecated Use the_permalink_rss() |
872 * @deprecated Use the_permalink_rss() |
909 * @see the_permalink_rss() |
873 * @see the_permalink_rss() |
910 * |
874 * |
911 * @param string $file |
875 * @param string $deprecated |
912 */ |
876 */ |
913 function permalink_single_rss($deprecated = '') { |
877 function permalink_single_rss($deprecated = '') { |
914 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); |
878 _deprecated_function( __FUNCTION__, '2.3', 'the_permalink_rss()' ); |
915 the_permalink_rss(); |
879 the_permalink_rss(); |
916 } |
880 } |
917 |
881 |
918 /** |
882 /** |
919 * Gets the links associated with category. |
883 * Gets the links associated with category. |
920 * |
884 * |
921 * @see get_links() for argument information that can be used in $args |
885 * @see get_links() for argument information that can be used in $args |
922 * @since 1.0.1 |
886 * @since 1.0.1 |
923 * @deprecated Use get_bookmarks() |
887 * @deprecated 2.1 |
924 * @see get_bookmarks() |
888 * @deprecated Use wp_list_bookmarks() |
889 * @see wp_list_bookmarks() |
|
925 * |
890 * |
926 * @param string $args a query string |
891 * @param string $args a query string |
927 * @return null|string |
892 * @return null|string |
928 */ |
893 */ |
929 function wp_get_links($args = '') { |
894 function wp_get_links($args = '') { |
930 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); |
895 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); |
931 |
896 |
932 if ( strpos( $args, '=' ) === false ) { |
897 if ( strpos( $args, '=' ) === false ) { |
933 $cat_id = $args; |
898 $cat_id = $args; |
934 $args = add_query_arg( 'category', $cat_id, $args ); |
899 $args = add_query_arg( 'category', $cat_id, $args ); |
935 } |
900 } |
936 |
901 |
937 $defaults = array( |
902 $defaults = array( |
938 'category' => -1, 'before' => '', |
903 'after' => '<br />', |
939 'after' => '<br />', 'between' => ' ', |
904 'before' => '', |
940 'show_images' => true, 'orderby' => 'name', |
905 'between' => ' ', |
941 'show_description' => true, 'show_rating' => false, |
906 'categorize' => 0, |
942 'limit' => -1, 'show_updated' => true, |
907 'category' => '', |
943 'echo' => true |
908 'echo' => true, |
909 'limit' => -1, |
|
910 'orderby' => 'name', |
|
911 'show_description' => true, |
|
912 'show_images' => true, |
|
913 'show_rating' => false, |
|
914 'show_updated' => true, |
|
915 'title_li' => '', |
|
944 ); |
916 ); |
945 |
917 |
946 $r = wp_parse_args( $args, $defaults ); |
918 $r = wp_parse_args( $args, $defaults ); |
947 extract( $r, EXTR_SKIP ); |
919 |
948 |
920 return wp_list_bookmarks($r); |
949 return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); |
|
950 } |
921 } |
951 |
922 |
952 /** |
923 /** |
953 * Gets the links associated with category by id. |
924 * Gets the links associated with category by id. |
954 * |
925 * |
955 * @since 0.71 |
926 * @since 0.71 |
927 * @deprecated 2.1 |
|
956 * @deprecated Use get_bookmarks() |
928 * @deprecated Use get_bookmarks() |
957 * @see get_bookmarks() |
929 * @see get_bookmarks() |
958 * |
930 * |
959 * @param int $category The category to use. If no category supplied uses all |
931 * @param int $category The category to use. If no category supplied uses all |
960 * @param string $before the html to output before the link |
932 * @param string $before the html to output before the link |
973 * @param bool $echo whether to echo the results, or return them instead |
945 * @param bool $echo whether to echo the results, or return them instead |
974 * @return null|string |
946 * @return null|string |
975 */ |
947 */ |
976 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name', |
948 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name', |
977 $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { |
949 $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { |
978 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); |
950 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); |
979 |
951 |
980 $order = 'ASC'; |
952 $order = 'ASC'; |
981 if ( substr($orderby, 0, 1) == '_' ) { |
953 if ( substr($orderby, 0, 1) == '_' ) { |
982 $order = 'DESC'; |
954 $order = 'DESC'; |
983 $orderby = substr($orderby, 1); |
955 $orderby = substr($orderby, 1); |
984 } |
956 } |
985 |
957 |
986 if ( $category == -1 ) //get_bookmarks uses '' to signify all categories |
958 if ( $category == -1 ) //get_bookmarks uses '' to signify all categories |
987 $category = ''; |
959 $category = ''; |
988 |
960 |
989 $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); |
961 $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit)); |
990 |
962 |
991 if ( !$results ) |
963 if ( !$results ) |
992 return; |
964 return; |
993 |
965 |
994 $output = ''; |
966 $output = ''; |
1058 * Output entire list of links by category. |
1030 * Output entire list of links by category. |
1059 * |
1031 * |
1060 * Output a list of all links, listed by category, using the settings in |
1032 * Output a list of all links, listed by category, using the settings in |
1061 * $wpdb->linkcategories and output it as a nested HTML unordered list. |
1033 * $wpdb->linkcategories and output it as a nested HTML unordered list. |
1062 * |
1034 * |
1063 * @author Dougal |
|
1064 * @since 1.0.1 |
1035 * @since 1.0.1 |
1036 * @deprecated 2.1 |
|
1065 * @deprecated Use wp_list_bookmarks() |
1037 * @deprecated Use wp_list_bookmarks() |
1066 * @see wp_list_bookmarks() |
1038 * @see wp_list_bookmarks() |
1067 * |
1039 * |
1068 * @param string $order Sort link categories by 'name' or 'id' |
1040 * @param string $order Sort link categories by 'name' or 'id' |
1069 * @param string $$deprecated Not Used |
1041 */ |
1070 */ |
1042 function get_links_list($order = 'name') { |
1071 function get_links_list($order = 'name', $deprecated = '') { |
1043 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); |
1072 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); |
|
1073 |
1044 |
1074 $order = strtolower($order); |
1045 $order = strtolower($order); |
1075 |
1046 |
1076 // Handle link category sorting |
1047 // Handle link category sorting |
1077 $direction = 'ASC'; |
1048 $direction = 'ASC'; |
1081 } |
1052 } |
1082 |
1053 |
1083 if ( !isset($direction) ) |
1054 if ( !isset($direction) ) |
1084 $direction = ''; |
1055 $direction = ''; |
1085 |
1056 |
1086 $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); |
1057 $cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0)); |
1087 |
1058 |
1088 // Display each category |
1059 // Display each category |
1089 if ( $cats ) { |
1060 if ( $cats ) { |
1090 foreach ( (array) $cats as $cat ) { |
1061 foreach ( (array) $cats as $cat ) { |
1091 // Handle each category. |
1062 // Handle each category. |
1102 } |
1073 } |
1103 |
1074 |
1104 /** |
1075 /** |
1105 * Show the link to the links popup and the number of links. |
1076 * Show the link to the links popup and the number of links. |
1106 * |
1077 * |
1107 * @author Fullo |
1078 * @since 0.71 |
1108 * @link http://sprite.csr.unibo.it/fullo/ |
1079 * @deprecated 2.1 |
1109 * |
|
1110 * @since 0.71 |
|
1111 * @deprecated {@internal Use function instead is unknown}} |
1080 * @deprecated {@internal Use function instead is unknown}} |
1112 * |
1081 * |
1113 * @param string $text the text of the link |
1082 * @param string $text the text of the link |
1114 * @param int $width the width of the popup window |
1083 * @param int $width the width of the popup window |
1115 * @param int $height the height of the popup window |
1084 * @param int $height the height of the popup window |
1116 * @param string $file the page to open in the popup window |
1085 * @param string $file the page to open in the popup window |
1117 * @param bool $count the number of links in the db |
1086 * @param bool $count the number of links in the db |
1118 */ |
1087 */ |
1119 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { |
1088 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { |
1120 _deprecated_function(__FUNCTION__, '0.0' ); |
1089 _deprecated_function( __FUNCTION__, '2.1' ); |
1121 |
1090 |
1122 if ( $count ) |
1091 if ( $count ) |
1123 $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); |
1092 $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); |
1124 |
1093 |
1125 $javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">"; |
1094 $javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">"; |
1132 echo $javascript; |
1101 echo $javascript; |
1133 } |
1102 } |
1134 |
1103 |
1135 /** |
1104 /** |
1136 * @since 1.0.1 |
1105 * @since 1.0.1 |
1106 * @deprecated 2.1 |
|
1137 * @deprecated Use sanitize_bookmark_field() |
1107 * @deprecated Use sanitize_bookmark_field() |
1138 * @see sanitize_bookmark_field() |
1108 * @see sanitize_bookmark_field() |
1139 * |
1109 * |
1140 * @param object $link |
1110 * @param object $link |
1141 * @return unknown |
1111 * @return unknown |
1142 */ |
1112 */ |
1143 function get_linkrating($link) { |
1113 function get_linkrating($link) { |
1144 _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()'); |
1114 _deprecated_function( __FUNCTION__, '2.1', 'sanitize_bookmark_field()' ); |
1145 return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); |
1115 return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); |
1146 } |
1116 } |
1147 |
1117 |
1148 /** |
1118 /** |
1149 * Gets the name of category by id. |
1119 * Gets the name of category by id. |
1150 * |
1120 * |
1151 * @since 0.71 |
1121 * @since 0.71 |
1122 * @deprecated 2.1 |
|
1152 * @deprecated Use get_category() |
1123 * @deprecated Use get_category() |
1153 * @see get_category() |
1124 * @see get_category() |
1154 * |
1125 * |
1155 * @param int $id The category to get. If no category supplied uses 0 |
1126 * @param int $id The category to get. If no category supplied uses 0 |
1156 * @return string |
1127 * @return string |
1157 */ |
1128 */ |
1158 function get_linkcatname($id = 0) { |
1129 function get_linkcatname($id = 0) { |
1159 _deprecated_function(__FUNCTION__, '0.0', 'get_category()'); |
1130 _deprecated_function( __FUNCTION__, '2.1', 'get_category()' ); |
1160 |
1131 |
1161 $id = (int) $id; |
1132 $id = (int) $id; |
1162 |
1133 |
1163 if ( empty($id) ) |
1134 if ( empty($id) ) |
1164 return ''; |
1135 return ''; |
1176 |
1147 |
1177 /** |
1148 /** |
1178 * Print RSS comment feed link. |
1149 * Print RSS comment feed link. |
1179 * |
1150 * |
1180 * @since 1.0.1 |
1151 * @since 1.0.1 |
1152 * @deprecated 2.5 |
|
1181 * @deprecated Use post_comments_feed_link() |
1153 * @deprecated Use post_comments_feed_link() |
1182 * @see post_comments_feed_link() |
1154 * @see post_comments_feed_link() |
1183 * |
1155 * |
1184 * @param string $link_text |
1156 * @param string $link_text |
1185 * @param string $deprecated Not used |
1157 */ |
1186 */ |
1158 function comments_rss_link($link_text = 'Comments RSS') { |
1187 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { |
1159 _deprecated_function( __FUNCTION__, '2.5', 'post_comments_feed_link()' ); |
1188 _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()'); |
|
1189 post_comments_feed_link($link_text); |
1160 post_comments_feed_link($link_text); |
1190 } |
1161 } |
1191 |
1162 |
1192 /** |
1163 /** |
1193 * Print/Return link to category RSS2 feed. |
1164 * Print/Return link to category RSS2 feed. |
1194 * |
1165 * |
1195 * @since 1.2 |
1166 * @since 1.2 |
1167 * @deprecated 2.5 |
|
1196 * @deprecated Use get_category_feed_link() |
1168 * @deprecated Use get_category_feed_link() |
1197 * @see get_category_feed_link() |
1169 * @see get_category_feed_link() |
1198 * |
1170 * |
1199 * @param bool $echo |
1171 * @param bool $echo |
1200 * @param int $cat_ID |
1172 * @param int $cat_ID |
1201 * @param string $deprecated Not used |
|
1202 * @return string|null |
1173 * @return string|null |
1203 */ |
1174 */ |
1204 function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { |
1175 function get_category_rss_link($echo = false, $cat_ID = 1) { |
1205 _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); |
1176 _deprecated_function( __FUNCTION__, '2.5', 'get_category_feed_link()' ); |
1206 |
1177 |
1207 $link = get_category_feed_link($cat_ID, 'rss2'); |
1178 $link = get_category_feed_link($cat_ID, 'rss2'); |
1208 |
1179 |
1209 if ( $echo ) |
1180 if ( $echo ) |
1210 echo $link; |
1181 echo $link; |
1213 |
1184 |
1214 /** |
1185 /** |
1215 * Print/Return link to author RSS feed. |
1186 * Print/Return link to author RSS feed. |
1216 * |
1187 * |
1217 * @since 1.2 |
1188 * @since 1.2 |
1189 * @deprecated 2.5 |
|
1218 * @deprecated Use get_author_feed_link() |
1190 * @deprecated Use get_author_feed_link() |
1219 * @see get_author_feed_link() |
1191 * @see get_author_feed_link() |
1220 * |
1192 * |
1221 * @param bool $echo |
1193 * @param bool $echo |
1222 * @param int $author_id |
1194 * @param int $author_id |
1223 * @param string $deprecated Not used |
|
1224 * @return string|null |
1195 * @return string|null |
1225 */ |
1196 */ |
1226 function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { |
1197 function get_author_rss_link($echo = false, $author_id = 1) { |
1227 _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()'); |
1198 _deprecated_function( __FUNCTION__, '2.5', 'get_author_feed_link()' ); |
1228 |
1199 |
1229 $link = get_author_feed_link($author_id); |
1200 $link = get_author_feed_link($author_id); |
1230 if ( $echo ) |
1201 if ( $echo ) |
1231 echo $link; |
1202 echo $link; |
1232 return $link; |
1203 return $link; |
1234 |
1205 |
1235 /** |
1206 /** |
1236 * Return link to the post RSS feed. |
1207 * Return link to the post RSS feed. |
1237 * |
1208 * |
1238 * @since 1.5 |
1209 * @since 1.5 |
1210 * @deprecated 2.2 |
|
1239 * @deprecated Use get_post_comments_feed_link() |
1211 * @deprecated Use get_post_comments_feed_link() |
1240 * @see get_post_comments_feed_link() |
1212 * @see get_post_comments_feed_link() |
1241 * |
1213 * |
1242 * @param string $deprecated Not used |
|
1243 * @return string |
1214 * @return string |
1244 */ |
1215 */ |
1245 function comments_rss($deprecated = '') { |
1216 function comments_rss() { |
1246 _deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()'); |
1217 _deprecated_function( __FUNCTION__, '2.2', 'get_post_comments_feed_link()' ); |
1247 return get_post_comments_feed_link(); |
1218 return get_post_comments_feed_link(); |
1248 } |
1219 } |
1249 |
1220 |
1250 /** |
1221 /** |
1251 * An alias of wp_create_user(). |
1222 * An alias of wp_create_user(). |
1223 * |
|
1224 * @since 2.0 |
|
1225 * @deprecated 2.0 |
|
1226 * @deprecated Use wp_create_user() |
|
1227 * @see wp_create_user() |
|
1252 * |
1228 * |
1253 * @param string $username The user's username. |
1229 * @param string $username The user's username. |
1254 * @param string $password The user's password. |
1230 * @param string $password The user's password. |
1255 * @param string $email The user's email (optional). |
1231 * @param string $email The user's email (optional). |
1256 * @return int The new user's ID. |
1232 * @return int The new user's ID. |
1257 * @deprecated Use wp_create_user() |
|
1258 * @see wp_create_user() |
|
1259 */ |
1233 */ |
1260 function create_user($username, $password, $email) { |
1234 function create_user($username, $password, $email) { |
1261 _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' ); |
1235 _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' ); |
1262 return wp_create_user($username, $password, $email); |
1236 return wp_create_user($username, $password, $email); |
1263 } |
1237 } |
1264 |
1238 |
1265 /** |
1239 /** |
1266 * Unused Admin function. |
|
1267 * |
|
1268 * @since 2.0 |
|
1269 * @param string $deprecated Unknown |
|
1270 * @deprecated 2.5 |
|
1271 */ |
|
1272 function documentation_link( $deprecated = '' ) { |
|
1273 _deprecated_function( __FUNCTION__, '2.5', '' ); |
|
1274 return; |
|
1275 } |
|
1276 |
|
1277 /** |
|
1278 * Unused function. |
1240 * Unused function. |
1279 * |
1241 * |
1280 * @deprecated 2.5 |
1242 * @deprecated 2.5 |
1281 */ |
1243 */ |
1282 function gzip_compression() { |
1244 function gzip_compression() { |
1245 _deprecated_function( __FUNCTION__, '2.5' ); |
|
1283 return false; |
1246 return false; |
1284 } |
1247 } |
1285 |
1248 |
1286 /** |
1249 /** |
1287 * Retrieve an array of comment data about comment $comment_ID. |
1250 * Retrieve an array of comment data about comment $comment_ID. |
1288 * |
1251 * |
1252 * @since 0.71 |
|
1253 * @deprecated 2.7 |
|
1289 * @deprecated Use get_comment() |
1254 * @deprecated Use get_comment() |
1290 * @see get_comment() |
1255 * @see get_comment() |
1291 * @since 0.71 |
|
1292 * |
|
1293 * @uses $id |
|
1294 * @uses $wpdb Database Object |
|
1295 * |
1256 * |
1296 * @param int $comment_ID The ID of the comment |
1257 * @param int $comment_ID The ID of the comment |
1297 * @param int $no_cache Whether to use the cache or not (casted to bool) |
1258 * @param int $no_cache Whether to use the cache (cast to bool) |
1298 * @param bool $include_unapproved Whether to include unapproved comments or not |
1259 * @param bool $include_unapproved Whether to include unapproved comments |
1299 * @return array The comment data |
1260 * @return array The comment data |
1300 */ |
1261 */ |
1301 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { |
1262 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { |
1302 _deprecated_function( __FUNCTION__, '2.7', 'get_comment()' ); |
1263 _deprecated_function( __FUNCTION__, '2.7', 'get_comment()' ); |
1303 return get_comment($comment_ID, ARRAY_A); |
1264 return get_comment($comment_ID, ARRAY_A); |
1305 |
1266 |
1306 /** |
1267 /** |
1307 * Retrieve the category name by the category ID. |
1268 * Retrieve the category name by the category ID. |
1308 * |
1269 * |
1309 * @since 0.71 |
1270 * @since 0.71 |
1271 * @deprecated 2.8 |
|
1310 * @deprecated Use get_cat_name() |
1272 * @deprecated Use get_cat_name() |
1311 * @see get_cat_name() get_catname() is deprecated in favor of get_cat_name(). |
1273 * @see get_cat_name() |
1312 * |
1274 * |
1313 * @param int $cat_ID Category ID |
1275 * @param int $cat_ID Category ID |
1314 * @return string category name |
1276 * @return string category name |
1315 */ |
1277 */ |
1316 function get_catname( $cat_ID ) { |
1278 function get_catname( $cat_ID ) { |
1317 _deprecated_function(__FUNCTION__, '2.8', 'get_cat_name()'); |
1279 _deprecated_function( __FUNCTION__, '2.8', 'get_cat_name()' ); |
1318 return get_cat_name( $cat_ID ); |
1280 return get_cat_name( $cat_ID ); |
1319 } |
1281 } |
1320 |
1282 |
1321 /** |
1283 /** |
1322 * Retrieve category children list separated before and after the term IDs. |
1284 * Retrieve category children list separated before and after the term IDs. |
1323 * |
1285 * |
1324 * @since 1.2.0 |
1286 * @since 1.2.0 |
1287 * @deprecated 2.8 |
|
1288 * @deprecated Use get_term_children() |
|
1289 * @see get_term_children() |
|
1325 * |
1290 * |
1326 * @param int $id Category ID to retrieve children. |
1291 * @param int $id Category ID to retrieve children. |
1327 * @param string $before Optional. Prepend before category term ID. |
1292 * @param string $before Optional. Prepend before category term ID. |
1328 * @param string $after Optional, default is empty string. Append after category term ID. |
1293 * @param string $after Optional, default is empty string. Append after category term ID. |
1329 * @param array $visited Optional. Category Term IDs that have already been added. |
1294 * @param array $visited Optional. Category Term IDs that have already been added. |
1330 * @return string |
1295 * @return string |
1331 */ |
1296 */ |
1332 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) { |
1297 function get_category_children( $id, $before = '/', $after = '', $visited = array() ) { |
1333 _deprecated_function(__FUNCTION__, '2.8', 'get_term_children()'); |
1298 _deprecated_function( __FUNCTION__, '2.8', 'get_term_children()' ); |
1334 if ( 0 == $id ) |
1299 if ( 0 == $id ) |
1335 return ''; |
1300 return ''; |
1336 |
1301 |
1337 $chain = ''; |
1302 $chain = ''; |
1338 /** TODO: consult hierarchy */ |
1303 /** TODO: consult hierarchy */ |
1356 /** |
1321 /** |
1357 * Retrieve the description of the author of the current post. |
1322 * Retrieve the description of the author of the current post. |
1358 * |
1323 * |
1359 * @since 1.5 |
1324 * @since 1.5 |
1360 * @deprecated 2.8 |
1325 * @deprecated 2.8 |
1361 * @uses $authordata The current author's DB object. |
1326 * @deprecated Use get_the_author_meta('description') |
1327 * @see get_the_author_meta() |
|
1328 * |
|
1362 * @return string The author's description. |
1329 * @return string The author's description. |
1363 * @deprecated Use the_author_meta('description') |
|
1364 */ |
1330 */ |
1365 function get_the_author_description() { |
1331 function get_the_author_description() { |
1366 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' ); |
1332 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' ); |
1367 return get_the_author_meta('description'); |
1333 return get_the_author_meta('description'); |
1368 } |
1334 } |
1369 |
1335 |
1370 /** |
1336 /** |
1371 * Display the description of the author of the current post. |
1337 * Display the description of the author of the current post. |
1372 * |
1338 * |
1373 * @link http://codex.wordpress.org/Template_Tags/the_author_description |
|
1374 * @since 1.0.0 |
1339 * @since 1.0.0 |
1375 * @deprecated 2.8 |
1340 * @deprecated 2.8 |
1376 * @deprecated Use the_author_meta('description') |
1341 * @deprecated Use the_author_meta('description') |
1342 * @see the_author_meta() |
|
1377 */ |
1343 */ |
1378 function the_author_description() { |
1344 function the_author_description() { |
1379 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')' ); |
1345 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' ); |
1380 the_author_meta('description'); |
1346 the_author_meta('description'); |
1381 } |
1347 } |
1382 |
1348 |
1383 /** |
1349 /** |
1384 * Retrieve the login name of the author of the current post. |
1350 * Retrieve the login name of the author of the current post. |
1385 * |
1351 * |
1386 * @since 1.5 |
1352 * @since 1.5 |
1387 * @deprecated 2.8 |
1353 * @deprecated 2.8 |
1388 * @uses $authordata The current author's DB object. |
1354 * @deprecated Use get_the_author_meta('login') |
1355 * @see get_the_author_meta() |
|
1356 * |
|
1389 * @return string The author's login name (username). |
1357 * @return string The author's login name (username). |
1390 * @deprecated Use the_author_meta('login') |
|
1391 */ |
1358 */ |
1392 function get_the_author_login() { |
1359 function get_the_author_login() { |
1393 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' ); |
1360 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' ); |
1394 return get_the_author_meta('login'); |
1361 return get_the_author_meta('login'); |
1395 } |
1362 } |
1396 |
1363 |
1397 /** |
1364 /** |
1398 * Display the login name of the author of the current post. |
1365 * Display the login name of the author of the current post. |
1399 * |
1366 * |
1400 * @link http://codex.wordpress.org/Template_Tags/the_author_login |
|
1401 * @since 0.71 |
1367 * @since 0.71 |
1402 * @deprecated 2.8 |
1368 * @deprecated 2.8 |
1403 * @deprecated Use the_author_meta('login') |
1369 * @deprecated Use the_author_meta('login') |
1370 * @see the_author_meta() |
|
1404 */ |
1371 */ |
1405 function the_author_login() { |
1372 function the_author_login() { |
1406 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'login\')' ); |
1373 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' ); |
1407 the_author_meta('login'); |
1374 the_author_meta('login'); |
1408 } |
1375 } |
1409 |
1376 |
1410 /** |
1377 /** |
1411 * Retrieve the first name of the author of the current post. |
1378 * Retrieve the first name of the author of the current post. |
1412 * |
1379 * |
1413 * @since 1.5 |
1380 * @since 1.5 |
1414 * @deprecated 2.8 |
1381 * @deprecated 2.8 |
1415 * @uses $authordata The current author's DB object. |
1382 * @deprecated Use get_the_author_meta('first_name') |
1383 * @see get_the_author_meta() |
|
1384 * |
|
1416 * @return string The author's first name. |
1385 * @return string The author's first name. |
1417 * @deprecated Use the_author_meta('first_name') |
|
1418 */ |
1386 */ |
1419 function get_the_author_firstname() { |
1387 function get_the_author_firstname() { |
1420 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' ); |
1388 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' ); |
1421 return get_the_author_meta('first_name'); |
1389 return get_the_author_meta('first_name'); |
1422 } |
1390 } |
1423 |
1391 |
1424 /** |
1392 /** |
1425 * Display the first name of the author of the current post. |
1393 * Display the first name of the author of the current post. |
1426 * |
1394 * |
1427 * @link http://codex.wordpress.org/Template_Tags/the_author_firstname |
|
1428 * @since 0.71 |
1395 * @since 0.71 |
1429 * @deprecated 2.8 |
1396 * @deprecated 2.8 |
1430 * @deprecated Use the_author_meta('first_name') |
1397 * @deprecated Use the_author_meta('first_name') |
1398 * @see the_author_meta() |
|
1431 */ |
1399 */ |
1432 function the_author_firstname() { |
1400 function the_author_firstname() { |
1433 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' ); |
1401 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' ); |
1434 the_author_meta('first_name'); |
1402 the_author_meta('first_name'); |
1435 } |
1403 } |
1436 |
1404 |
1437 /** |
1405 /** |
1438 * Retrieve the last name of the author of the current post. |
1406 * Retrieve the last name of the author of the current post. |
1439 * |
1407 * |
1440 * @since 1.5 |
1408 * @since 1.5 |
1441 * @deprecated 2.8 |
1409 * @deprecated 2.8 |
1442 * @uses $authordata The current author's DB object. |
1410 * @deprecated Use get_the_author_meta('last_name') |
1411 * @see get_the_author_meta() |
|
1412 * |
|
1443 * @return string The author's last name. |
1413 * @return string The author's last name. |
1444 * @deprecated Use the_author_meta('last_name') |
|
1445 */ |
1414 */ |
1446 function get_the_author_lastname() { |
1415 function get_the_author_lastname() { |
1447 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' ); |
1416 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' ); |
1448 return get_the_author_meta('last_name'); |
1417 return get_the_author_meta('last_name'); |
1449 } |
1418 } |
1450 |
1419 |
1451 /** |
1420 /** |
1452 * Display the last name of the author of the current post. |
1421 * Display the last name of the author of the current post. |
1453 * |
1422 * |
1454 * @link http://codex.wordpress.org/Template_Tags/the_author_lastname |
|
1455 * @since 0.71 |
1423 * @since 0.71 |
1456 * @deprecated 2.8 |
1424 * @deprecated 2.8 |
1457 * @deprecated Use the_author_meta('last_name') |
1425 * @deprecated Use the_author_meta('last_name') |
1426 * @see the_author_meta() |
|
1458 */ |
1427 */ |
1459 function the_author_lastname() { |
1428 function the_author_lastname() { |
1460 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' ); |
1429 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' ); |
1461 the_author_meta('last_name'); |
1430 the_author_meta('last_name'); |
1462 } |
1431 } |
1463 |
1432 |
1464 /** |
1433 /** |
1465 * Retrieve the nickname of the author of the current post. |
1434 * Retrieve the nickname of the author of the current post. |
1466 * |
1435 * |
1467 * @since 1.5 |
1436 * @since 1.5 |
1468 * @deprecated 2.8 |
1437 * @deprecated 2.8 |
1469 * @uses $authordata The current author's DB object. |
1438 * @deprecated Use get_the_author_meta('nickname') |
1439 * @see get_the_author_meta() |
|
1440 * |
|
1470 * @return string The author's nickname. |
1441 * @return string The author's nickname. |
1471 * @deprecated Use the_author_meta('nickname') |
|
1472 */ |
1442 */ |
1473 function get_the_author_nickname() { |
1443 function get_the_author_nickname() { |
1474 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); |
1444 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); |
1475 return get_the_author_meta('nickname'); |
1445 return get_the_author_meta('nickname'); |
1476 } |
1446 } |
1477 |
1447 |
1478 /** |
1448 /** |
1479 * Display the nickname of the author of the current post. |
1449 * Display the nickname of the author of the current post. |
1480 * |
1450 * |
1481 * @link http://codex.wordpress.org/Template_Tags/the_author_nickname |
|
1482 * @since 0.71 |
1451 * @since 0.71 |
1483 * @deprecated 2.8 |
1452 * @deprecated 2.8 |
1484 * @deprecated Use the_author_meta('nickname') |
1453 * @deprecated Use the_author_meta('nickname') |
1454 * @see the_author_meta() |
|
1485 */ |
1455 */ |
1486 function the_author_nickname() { |
1456 function the_author_nickname() { |
1487 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); |
1457 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); |
1488 the_author_meta('nickname'); |
1458 the_author_meta('nickname'); |
1489 } |
1459 } |
1490 |
1460 |
1491 /** |
1461 /** |
1492 * Retrieve the email of the author of the current post. |
1462 * Retrieve the email of the author of the current post. |
1493 * |
1463 * |
1494 * @since 1.5 |
1464 * @since 1.5 |
1495 * @deprecated 2.8 |
1465 * @deprecated 2.8 |
1496 * @uses $authordata The current author's DB object. |
1466 * @deprecated Use get_the_author_meta('email') |
1467 * @see get_the_author_meta() |
|
1468 * |
|
1497 * @return string The author's username. |
1469 * @return string The author's username. |
1498 * @deprecated Use the_author_meta('email') |
|
1499 */ |
1470 */ |
1500 function get_the_author_email() { |
1471 function get_the_author_email() { |
1501 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); |
1472 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); |
1502 return get_the_author_meta('email'); |
1473 return get_the_author_meta('email'); |
1503 } |
1474 } |
1504 |
1475 |
1505 /** |
1476 /** |
1506 * Display the email of the author of the current post. |
1477 * Display the email of the author of the current post. |
1507 * |
1478 * |
1508 * @link http://codex.wordpress.org/Template_Tags/the_author_email |
|
1509 * @since 0.71 |
1479 * @since 0.71 |
1510 * @deprecated 2.8 |
1480 * @deprecated 2.8 |
1511 * @deprecated Use the_author_meta('email') |
1481 * @deprecated Use the_author_meta('email') |
1482 * @see the_author_meta() |
|
1512 */ |
1483 */ |
1513 function the_author_email() { |
1484 function the_author_email() { |
1514 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); |
1485 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); |
1515 the_author_meta('email'); |
1486 the_author_meta('email'); |
1516 } |
1487 } |
1517 |
1488 |
1518 /** |
1489 /** |
1519 * Retrieve the ICQ number of the author of the current post. |
1490 * Retrieve the ICQ number of the author of the current post. |
1520 * |
1491 * |
1521 * @since 1.5 |
1492 * @since 1.5 |
1522 * @deprecated 2.8 |
1493 * @deprecated 2.8 |
1523 * @uses $authordata The current author's DB object. |
1494 * @deprecated Use get_the_author_meta('icq') |
1495 * @see get_the_author_meta() |
|
1496 * |
|
1524 * @return string The author's ICQ number. |
1497 * @return string The author's ICQ number. |
1498 */ |
|
1499 function get_the_author_icq() { |
|
1500 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); |
|
1501 return get_the_author_meta('icq'); |
|
1502 } |
|
1503 |
|
1504 /** |
|
1505 * Display the ICQ number of the author of the current post. |
|
1506 * |
|
1507 * @since 0.71 |
|
1508 * @deprecated 2.8 |
|
1525 * @deprecated Use the_author_meta('icq') |
1509 * @deprecated Use the_author_meta('icq') |
1526 */ |
1510 * @see the_author_meta() |
1527 function get_the_author_icq() { |
|
1528 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); |
|
1529 return get_the_author_meta('icq'); |
|
1530 } |
|
1531 |
|
1532 /** |
|
1533 * Display the ICQ number of the author of the current post. |
|
1534 * |
|
1535 * @link http://codex.wordpress.org/Template_Tags/the_author_icq |
|
1536 * @since 0.71 |
|
1537 * @deprecated 2.8 |
|
1538 * @see get_the_author_icq() |
|
1539 * @deprecated Use the_author_meta('icq') |
|
1540 */ |
1511 */ |
1541 function the_author_icq() { |
1512 function the_author_icq() { |
1542 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); |
1513 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); |
1543 the_author_meta('icq'); |
1514 the_author_meta('icq'); |
1544 } |
1515 } |
1545 |
1516 |
1546 /** |
1517 /** |
1547 * Retrieve the Yahoo! IM name of the author of the current post. |
1518 * Retrieve the Yahoo! IM name of the author of the current post. |
1548 * |
1519 * |
1549 * @since 1.5 |
1520 * @since 1.5 |
1550 * @deprecated 2.8 |
1521 * @deprecated 2.8 |
1551 * @uses $authordata The current author's DB object. |
1522 * @deprecated Use get_the_author_meta('yim') |
1523 * @see get_the_author_meta() |
|
1524 * |
|
1552 * @return string The author's Yahoo! IM name. |
1525 * @return string The author's Yahoo! IM name. |
1553 * @deprecated Use the_author_meta('yim') |
|
1554 */ |
1526 */ |
1555 function get_the_author_yim() { |
1527 function get_the_author_yim() { |
1556 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); |
1528 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); |
1557 return get_the_author_meta('yim'); |
1529 return get_the_author_meta('yim'); |
1558 } |
1530 } |
1559 |
1531 |
1560 /** |
1532 /** |
1561 * Display the Yahoo! IM name of the author of the current post. |
1533 * Display the Yahoo! IM name of the author of the current post. |
1562 * |
1534 * |
1563 * @link http://codex.wordpress.org/Template_Tags/the_author_yim |
|
1564 * @since 0.71 |
1535 * @since 0.71 |
1565 * @deprecated 2.8 |
1536 * @deprecated 2.8 |
1566 * @deprecated Use the_author_meta('yim') |
1537 * @deprecated Use the_author_meta('yim') |
1538 * @see the_author_meta() |
|
1567 */ |
1539 */ |
1568 function the_author_yim() { |
1540 function the_author_yim() { |
1569 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); |
1541 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); |
1570 the_author_meta('yim'); |
1542 the_author_meta('yim'); |
1571 } |
1543 } |
1572 |
1544 |
1573 /** |
1545 /** |
1574 * Retrieve the MSN address of the author of the current post. |
1546 * Retrieve the MSN address of the author of the current post. |
1575 * |
1547 * |
1576 * @since 1.5 |
1548 * @since 1.5 |
1577 * @deprecated 2.8 |
1549 * @deprecated 2.8 |
1578 * @uses $authordata The current author's DB object. |
1550 * @deprecated Use get_the_author_meta('msn') |
1551 * @see get_the_author_meta() |
|
1552 * |
|
1579 * @return string The author's MSN address. |
1553 * @return string The author's MSN address. |
1554 */ |
|
1555 function get_the_author_msn() { |
|
1556 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); |
|
1557 return get_the_author_meta('msn'); |
|
1558 } |
|
1559 |
|
1560 /** |
|
1561 * Display the MSN address of the author of the current post. |
|
1562 * |
|
1563 * @since 0.71 |
|
1564 * @deprecated 2.8 |
|
1580 * @deprecated Use the_author_meta('msn') |
1565 * @deprecated Use the_author_meta('msn') |
1581 */ |
1566 * @see the_author_meta() |
1582 function get_the_author_msn() { |
|
1583 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); |
|
1584 return get_the_author_meta('msn'); |
|
1585 } |
|
1586 |
|
1587 /** |
|
1588 * Display the MSN address of the author of the current post. |
|
1589 * |
|
1590 * @link http://codex.wordpress.org/Template_Tags/the_author_msn |
|
1591 * @since 0.71 |
|
1592 * @deprecated 2.8 |
|
1593 * @see get_the_author_msn() |
|
1594 * @deprecated Use the_author_meta('msn') |
|
1595 */ |
1567 */ |
1596 function the_author_msn() { |
1568 function the_author_msn() { |
1597 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); |
1569 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); |
1598 the_author_meta('msn'); |
1570 the_author_meta('msn'); |
1599 } |
1571 } |
1600 |
1572 |
1601 /** |
1573 /** |
1602 * Retrieve the AIM address of the author of the current post. |
1574 * Retrieve the AIM address of the author of the current post. |
1603 * |
1575 * |
1604 * @since 1.5 |
1576 * @since 1.5 |
1605 * @deprecated 2.8 |
1577 * @deprecated 2.8 |
1606 * @uses $authordata The current author's DB object. |
1578 * @deprecated Use get_the_author_meta('aim') |
1579 * @see get_the_author_meta() |
|
1580 * |
|
1607 * @return string The author's AIM address. |
1581 * @return string The author's AIM address. |
1582 */ |
|
1583 function get_the_author_aim() { |
|
1584 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); |
|
1585 return get_the_author_meta('aim'); |
|
1586 } |
|
1587 |
|
1588 /** |
|
1589 * Display the AIM address of the author of the current post. |
|
1590 * |
|
1591 * @since 0.71 |
|
1592 * @see the_author_meta() |
|
1593 * @deprecated 2.8 |
|
1608 * @deprecated Use the_author_meta('aim') |
1594 * @deprecated Use the_author_meta('aim') |
1609 */ |
1595 */ |
1610 function get_the_author_aim() { |
|
1611 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); |
|
1612 return get_the_author_meta('aim'); |
|
1613 } |
|
1614 |
|
1615 /** |
|
1616 * Display the AIM address of the author of the current post. |
|
1617 * |
|
1618 * @link http://codex.wordpress.org/Template_Tags/the_author_aim |
|
1619 * @since 0.71 |
|
1620 * @deprecated 2.8 |
|
1621 * @see get_the_author_aim() |
|
1622 * @deprecated Use the_author_meta('aim') |
|
1623 */ |
|
1624 function the_author_aim() { |
1596 function the_author_aim() { |
1625 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); |
1597 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); |
1626 the_author_meta('aim'); |
1598 the_author_meta('aim'); |
1627 } |
1599 } |
1628 |
1600 |
1629 /** |
1601 /** |
1630 * Retrieve the specified author's preferred display name. |
1602 * Retrieve the specified author's preferred display name. |
1631 * |
1603 * |
1632 * @since 1.0.0 |
1604 * @since 1.0.0 |
1633 * @deprecated 2.8 |
1605 * @deprecated 2.8 |
1606 * @deprecated Use get_the_author_meta('display_name') |
|
1607 * @see get_the_author_meta() |
|
1608 * |
|
1634 * @param int $auth_id The ID of the author. |
1609 * @param int $auth_id The ID of the author. |
1635 * @return string The author's display name. |
1610 * @return string The author's display name. |
1636 * @deprecated Use the_author_meta('display_name') |
|
1637 */ |
1611 */ |
1638 function get_author_name( $auth_id = false ) { |
1612 function get_author_name( $auth_id = false ) { |
1639 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); |
1613 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); |
1640 return get_the_author_meta('display_name', $auth_id); |
1614 return get_the_author_meta('display_name', $auth_id); |
1641 } |
1615 } |
1642 |
1616 |
1643 /** |
1617 /** |
1644 * Retrieve the URL to the home page of the author of the current post. |
1618 * Retrieve the URL to the home page of the author of the current post. |
1645 * |
1619 * |
1646 * @since 1.5 |
1620 * @since 1.5 |
1647 * @deprecated 2.8 |
1621 * @deprecated 2.8 |
1648 * @uses $authordata The current author's DB object. |
1622 * @deprecated Use get_the_author_meta('url') |
1623 * @see get_the_author_meta() |
|
1624 * |
|
1649 * @return string The URL to the author's page. |
1625 * @return string The URL to the author's page. |
1650 */ |
1626 */ |
1651 function get_the_author_url() { |
1627 function get_the_author_url() { |
1652 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); |
1628 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); |
1653 return get_the_author_meta('url'); |
1629 return get_the_author_meta('url'); |
1654 } |
1630 } |
1655 |
1631 |
1656 /** |
1632 /** |
1657 * Display the URL to the home page of the author of the current post. |
1633 * Display the URL to the home page of the author of the current post. |
1658 * |
1634 * |
1659 * @link http://codex.wordpress.org/Template_Tags/the_author_url |
|
1660 * @since 0.71 |
1635 * @since 0.71 |
1661 * @deprecated 2.8 |
1636 * @deprecated 2.8 |
1637 * @deprecated Use the_author_meta('url') |
|
1638 * @see the_author_meta() |
|
1662 */ |
1639 */ |
1663 function the_author_url() { |
1640 function the_author_url() { |
1664 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); |
1641 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); |
1665 the_author_meta('url'); |
1642 the_author_meta('url'); |
1666 } |
1643 } |
1667 |
1644 |
1668 /** |
1645 /** |
1669 * Retrieve the ID of the author of the current post. |
1646 * Retrieve the ID of the author of the current post. |
1670 * |
1647 * |
1671 * @since 1.5 |
1648 * @since 1.5 |
1672 * @deprecated 2.8 |
1649 * @deprecated 2.8 |
1650 * @deprecated Use get_the_author_meta('ID') |
|
1651 * @see get_the_author_meta() |
|
1652 * |
|
1673 * @return int The author's ID. |
1653 * @return int The author's ID. |
1674 */ |
1654 */ |
1675 function get_the_author_ID() { |
1655 function get_the_author_ID() { |
1676 _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); |
1656 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); |
1677 return get_the_author_meta('ID'); |
1657 return get_the_author_meta('ID'); |
1678 } |
1658 } |
1679 |
1659 |
1680 /** |
1660 /** |
1681 * Display the ID of the author of the current post. |
1661 * Display the ID of the author of the current post. |
1682 * |
1662 * |
1683 * @link http://codex.wordpress.org/Template_Tags/the_author_ID |
|
1684 * @since 0.71 |
1663 * @since 0.71 |
1685 * @deprecated 2.8 |
1664 * @deprecated 2.8 |
1686 * @uses get_the_author_ID() |
1665 * @deprecated Use the_author_meta('ID') |
1666 * @see the_author_meta() |
|
1687 */ |
1667 */ |
1688 function the_author_ID() { |
1668 function the_author_ID() { |
1689 _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); |
1669 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); |
1690 the_author_meta('ID'); |
1670 the_author_meta('ID'); |
1691 } |
1671 } |
1692 |
1672 |
1693 /** |
1673 /** |
1694 * Display the post content for the feed. |
1674 * Display the post content for the feed. |
1713 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. |
1693 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. |
1714 * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file |
1694 * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file |
1715 * parameters. |
1695 * parameters. |
1716 * |
1696 * |
1717 * @deprecated 2.9.0 |
1697 * @deprecated 2.9.0 |
1698 * @deprecated Use the_content_feed() |
|
1699 * @see the_content_feed() |
|
1718 * |
1700 * |
1719 * @param string $more_link_text Optional. Text to display when more content is available but not displayed. |
1701 * @param string $more_link_text Optional. Text to display when more content is available but not displayed. |
1720 * @param int|bool $stripteaser Optional. Default is 0. |
1702 * @param int|bool $stripteaser Optional. Default is 0. |
1721 * @param string $more_file Optional. |
1703 * @param string $more_file Optional. |
1722 * @param int $cut Optional. Amount of words to keep for the content. |
1704 * @param int $cut Optional. Amount of words to keep for the content. |
1723 * @param int $encode_html Optional. How to encode the content. |
1705 * @param int $encode_html Optional. How to encode the content. |
1724 */ |
1706 */ |
1725 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { |
1707 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { |
1726 _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' ); |
1708 _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' ); |
1727 $content = get_the_content($more_link_text, $stripteaser, $more_file); |
1709 $content = get_the_content($more_link_text, $stripteaser, $more_file); |
1728 $content = apply_filters('the_content_rss', $content); |
1710 $content = apply_filters('the_content_rss', $content); |
1729 if ( $cut && !$encode_html ) |
1711 if ( $cut && !$encode_html ) |
1730 $encode_html = 2; |
1712 $encode_html = 2; |
1731 if ( 1== $encode_html ) { |
1713 if ( 1== $encode_html ) { |
1767 * |
1749 * |
1768 * @param string $content Content to get links |
1750 * @param string $content Content to get links |
1769 * @return string HTML stripped out of content with links at the bottom. |
1751 * @return string HTML stripped out of content with links at the bottom. |
1770 */ |
1752 */ |
1771 function make_url_footnote( $content ) { |
1753 function make_url_footnote( $content ) { |
1772 _deprecated_function(__FUNCTION__, '2.9', '' ); |
1754 _deprecated_function( __FUNCTION__, '2.9', '' ); |
1773 preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); |
1755 preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); |
1774 $links_summary = "\n"; |
1756 $links_summary = "\n"; |
1775 for ( $i=0; $i<count($matches[0]); $i++ ) { |
1757 for ( $i=0; $i<count($matches[0]); $i++ ) { |
1776 $link_match = $matches[0][$i]; |
1758 $link_match = $matches[0][$i]; |
1777 $link_number = '['.($i+1).']'; |
1759 $link_number = '['.($i+1).']'; |
1799 * including the pipe character. If there is no pipe in the translated text then |
1781 * including the pipe character. If there is no pipe in the translated text then |
1800 * everything is returned. |
1782 * everything is returned. |
1801 * |
1783 * |
1802 * @since 2.2.0 |
1784 * @since 2.2.0 |
1803 * @deprecated 2.9.0 |
1785 * @deprecated 2.9.0 |
1786 * @deprecated Use _x() |
|
1787 * @see _x() |
|
1804 * |
1788 * |
1805 * @param string $text Text to translate |
1789 * @param string $text Text to translate |
1806 * @param string $domain Optional. Domain to retrieve the translated text |
1790 * @param string $domain Optional. Domain to retrieve the translated text |
1807 * @return string Translated context string without pipe |
1791 * @return string Translated context string without pipe |
1808 */ |
1792 */ |
1809 function _c( $text, $domain = 'default' ) { |
1793 function _c( $text, $domain = 'default' ) { |
1810 _deprecated_function(__FUNCTION__, '2.9', '_x' ); |
1794 _deprecated_function( __FUNCTION__, '2.9', '_x()' ); |
1811 return translate_with_context( $text, $domain ); |
1795 return before_last_bar( translate( $text, $domain ) ); |
1812 } |
1796 } |
1813 ?> |
1797 |
1798 /** |
|
1799 * Translates $text like translate(), but assumes that the text |
|
1800 * contains a context after its last vertical bar. |
|
1801 * |
|
1802 * @since 2.5 |
|
1803 * @uses translate() |
|
1804 * @deprecated 3.0.0 |
|
1805 * @deprecated Use _x() |
|
1806 * @see _x() |
|
1807 * |
|
1808 * @param string $text Text to translate |
|
1809 * @param string $domain Domain to retrieve the translated text |
|
1810 * @return string Translated text |
|
1811 */ |
|
1812 function translate_with_context( $text, $domain = 'default' ) { |
|
1813 _deprecated_function( __FUNCTION__, '2.9', '_x()' ); |
|
1814 return before_last_bar( translate( $text, $domain ) ); |
|
1815 } |
|
1816 |
|
1817 /** |
|
1818 * A version of _n(), which supports contexts. |
|
1819 * Strips everything from the translation after the last bar. |
|
1820 * |
|
1821 * @since 2.7.0 |
|
1822 * @deprecated 3.0.0 |
|
1823 * @deprecated Use _nx() |
|
1824 * @see _nx() |
|
1825 * @see _n() For parameters. |
|
1826 * @see _c() For parameters. _c() is deprecated. |
|
1827 * |
|
1828 */ |
|
1829 function _nc( $single, $plural, $number, $domain = 'default' ) { |
|
1830 _deprecated_function( __FUNCTION__, '2.9', '_nx()' ); |
|
1831 return before_last_bar( _n( $single, $plural, $number, $domain ) ); |
|
1832 } |
|
1833 |
|
1834 /** |
|
1835 * Retrieve the plural or single form based on the amount. |
|
1836 * |
|
1837 * @since 1.2.0 |
|
1838 * @deprecated 2.8.0 |
|
1839 * @deprecated Use _n() |
|
1840 * @see _n() |
|
1841 */ |
|
1842 function __ngettext() { |
|
1843 _deprecated_function( __FUNCTION__, '2.8', '_n()' ); |
|
1844 $args = func_get_args(); |
|
1845 return call_user_func_array('_n', $args); |
|
1846 } |
|
1847 |
|
1848 /** |
|
1849 * Register plural strings in POT file, but don't translate them. |
|
1850 * |
|
1851 * @since 2.5 |
|
1852 * @deprecated 2.8.0 |
|
1853 * @deprecated Use _n_noop() |
|
1854 * @see _n_noop() |
|
1855 */ |
|
1856 function __ngettext_noop() { |
|
1857 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' ); |
|
1858 $args = func_get_args(); |
|
1859 return call_user_func_array('_n_noop', $args); |
|
1860 |
|
1861 } |
|
1862 |
|
1863 /** |
|
1864 * Retrieve all autoload options, or all options if no autoloaded ones exist. |
|
1865 * |
|
1866 * @since 1.0.0 |
|
1867 * @deprecated 3.0.0 |
|
1868 * @deprecated Use wp_load_alloptions()) |
|
1869 * @see wp_load_alloptions() |
|
1870 * |
|
1871 * @return array List of all options. |
|
1872 */ |
|
1873 function get_alloptions() { |
|
1874 _deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' ); |
|
1875 return wp_load_alloptions(); |
|
1876 } |
|
1877 |
|
1878 /** |
|
1879 * Retrieve HTML content of attachment image with link. |
|
1880 * |
|
1881 * @since 2.0.0 |
|
1882 * @deprecated 2.5.0 |
|
1883 * @deprecated Use wp_get_attachment_link() |
|
1884 * @see wp_get_attachment_link() |
|
1885 * |
|
1886 * @param int $id Optional. Post ID. |
|
1887 * @param bool $fullsize Optional, default is false. Whether to use full size image. |
|
1888 * @param array $max_dims Optional. Max image dimensions. |
|
1889 * @param bool $permalink Optional, default is false. Whether to include permalink to image. |
|
1890 * @return string |
|
1891 */ |
|
1892 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { |
|
1893 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' ); |
|
1894 $id = (int) $id; |
|
1895 $_post = & get_post($id); |
|
1896 |
|
1897 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) |
|
1898 return __('Missing Attachment'); |
|
1899 |
|
1900 if ( $permalink ) |
|
1901 $url = get_attachment_link($_post->ID); |
|
1902 |
|
1903 $post_title = esc_attr($_post->post_title); |
|
1904 |
|
1905 $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); |
|
1906 return "<a href='$url' title='$post_title'>$innerHTML</a>"; |
|
1907 } |
|
1908 |
|
1909 /** |
|
1910 * Retrieve icon URL and Path. |
|
1911 * |
|
1912 * @since 2.1.0 |
|
1913 * @deprecated 2.5.0 |
|
1914 * @deprecated Use wp_get_attachment_image_src() |
|
1915 * @see wp_get_attachment_image_src() |
|
1916 * |
|
1917 * @param int $id Optional. Post ID. |
|
1918 * @param bool $fullsize Optional, default to false. Whether to have full image. |
|
1919 * @return array Icon URL and full path to file, respectively. |
|
1920 */ |
|
1921 function get_attachment_icon_src( $id = 0, $fullsize = false ) { |
|
1922 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); |
|
1923 $id = (int) $id; |
|
1924 if ( !$post = & get_post($id) ) |
|
1925 return false; |
|
1926 |
|
1927 $file = get_attached_file( $post->ID ); |
|
1928 |
|
1929 if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { |
|
1930 // We have a thumbnail desired, specified and existing |
|
1931 |
|
1932 $src_file = basename($src); |
|
1933 $class = 'attachmentthumb'; |
|
1934 } elseif ( wp_attachment_is_image( $post->ID ) ) { |
|
1935 // We have an image without a thumbnail |
|
1936 |
|
1937 $src = wp_get_attachment_url( $post->ID ); |
|
1938 $src_file = & $file; |
|
1939 $class = 'attachmentimage'; |
|
1940 } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { |
|
1941 // No thumb, no image. We'll look for a mime-related icon instead. |
|
1942 |
|
1943 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); |
|
1944 $src_file = $icon_dir . '/' . basename($src); |
|
1945 } |
|
1946 |
|
1947 if ( !isset($src) || !$src ) |
|
1948 return false; |
|
1949 |
|
1950 return array($src, $src_file); |
|
1951 } |
|
1952 |
|
1953 /** |
|
1954 * Retrieve HTML content of icon attachment image element. |
|
1955 * |
|
1956 * @since 2.0.0 |
|
1957 * @deprecated 2.5.0 |
|
1958 * @deprecated Use wp_get_attachment_image() |
|
1959 * @see wp_get_attachment_image() |
|
1960 * |
|
1961 * @param int $id Optional. Post ID. |
|
1962 * @param bool $fullsize Optional, default to false. Whether to have full size image. |
|
1963 * @param array $max_dims Optional. Dimensions of image. |
|
1964 * @return string HTML content. |
|
1965 */ |
|
1966 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { |
|
1967 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); |
|
1968 $id = (int) $id; |
|
1969 if ( !$post = & get_post($id) ) |
|
1970 return false; |
|
1971 |
|
1972 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) |
|
1973 return false; |
|
1974 |
|
1975 list($src, $src_file) = $src; |
|
1976 |
|
1977 // Do we need to constrain the image? |
|
1978 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { |
|
1979 |
|
1980 $imagesize = getimagesize($src_file); |
|
1981 |
|
1982 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { |
|
1983 $actual_aspect = $imagesize[0] / $imagesize[1]; |
|
1984 $desired_aspect = $max_dims[0] / $max_dims[1]; |
|
1985 |
|
1986 if ( $actual_aspect >= $desired_aspect ) { |
|
1987 $height = $actual_aspect * $max_dims[0]; |
|
1988 $constraint = "width='{$max_dims[0]}' "; |
|
1989 $post->iconsize = array($max_dims[0], $height); |
|
1990 } else { |
|
1991 $width = $max_dims[1] / $actual_aspect; |
|
1992 $constraint = "height='{$max_dims[1]}' "; |
|
1993 $post->iconsize = array($width, $max_dims[1]); |
|
1994 } |
|
1995 } else { |
|
1996 $post->iconsize = array($imagesize[0], $imagesize[1]); |
|
1997 $constraint = ''; |
|
1998 } |
|
1999 } else { |
|
2000 $constraint = ''; |
|
2001 } |
|
2002 |
|
2003 $post_title = esc_attr($post->post_title); |
|
2004 |
|
2005 $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>"; |
|
2006 |
|
2007 return apply_filters( 'attachment_icon', $icon, $post->ID ); |
|
2008 } |
|
2009 |
|
2010 /** |
|
2011 * Retrieve HTML content of image element. |
|
2012 * |
|
2013 * @since 2.0.0 |
|
2014 * @deprecated 2.5.0 |
|
2015 * @deprecated Use wp_get_attachment_image() |
|
2016 * @see wp_get_attachment_image() |
|
2017 * |
|
2018 * @param int $id Optional. Post ID. |
|
2019 * @param bool $fullsize Optional, default to false. Whether to have full size image. |
|
2020 * @param array $max_dims Optional. Dimensions of image. |
|
2021 * @return string |
|
2022 */ |
|
2023 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { |
|
2024 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); |
|
2025 $id = (int) $id; |
|
2026 if ( !$post = & get_post($id) ) |
|
2027 return false; |
|
2028 |
|
2029 if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) |
|
2030 return $innerHTML; |
|
2031 |
|
2032 $innerHTML = esc_attr($post->post_title); |
|
2033 |
|
2034 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); |
|
2035 } |
|
2036 |
|
2037 /** |
|
2038 * Retrieve bookmark data based on ID. |
|
2039 * |
|
2040 * @since 2.0.0 |
|
2041 * @deprecated 2.1.0 |
|
2042 * @deprecated Use get_bookmark() |
|
2043 * @see get_bookmark() |
|
2044 * |
|
2045 * @param int $bookmark_id ID of link |
|
2046 * @param string $output OBJECT, ARRAY_N, or ARRAY_A |
|
2047 * @return object|array |
|
2048 */ |
|
2049 function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') { |
|
2050 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmark()' ); |
|
2051 return get_bookmark($bookmark_id, $output, $filter); |
|
2052 } |
|
2053 |
|
2054 /** |
|
2055 * Performs esc_url() for database or redirect usage. |
|
2056 * |
|
2057 * @since 2.3.1 |
|
2058 * @deprecated 2.8.0 |
|
2059 * @deprecated Use esc_url_raw() |
|
2060 * @see esc_url_raw() |
|
2061 * |
|
2062 * @param string $url The URL to be cleaned. |
|
2063 * @param array $protocols An array of acceptable protocols. |
|
2064 * @return string The cleaned URL. |
|
2065 */ |
|
2066 function sanitize_url( $url, $protocols = null ) { |
|
2067 _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' ); |
|
2068 return esc_url_raw( $url, $protocols ); |
|
2069 } |
|
2070 |
|
2071 /** |
|
2072 * Checks and cleans a URL. |
|
2073 * |
|
2074 * A number of characters are removed from the URL. If the URL is for displaying |
|
2075 * (the default behaviour) ampersands are also replaced. The 'clean_url' filter |
|
2076 * is applied to the returned cleaned URL. |
|
2077 * |
|
2078 * @since 1.2.0 |
|
2079 * @deprecated 3.0.0 |
|
2080 * @deprecated Use esc_url() |
|
2081 * @see Alias for esc_url() |
|
2082 * |
|
2083 * @param string $url The URL to be cleaned. |
|
2084 * @param array $protocols Optional. An array of acceptable protocols. |
|
2085 * @param string $context Optional. How the URL will be used. Default is 'display'. |
|
2086 * @return string The cleaned $url after the 'clean_url' filter is applied. |
|
2087 */ |
|
2088 function clean_url( $url, $protocols = null, $context = 'display' ) { |
|
2089 if ( $context == 'db' ) |
|
2090 _deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' ); |
|
2091 else |
|
2092 _deprecated_function( __FUNCTION__, '3.0', 'esc_url()' ); |
|
2093 return esc_url( $url, $protocols, $context ); |
|
2094 } |
|
2095 |
|
2096 /** |
|
2097 * Escape single quotes, specialchar double quotes, and fix line endings. |
|
2098 * |
|
2099 * The filter 'js_escape' is also applied by esc_js() |
|
2100 * |
|
2101 * @since 2.0.4 |
|
2102 * @deprecated 2.8.0 |
|
2103 * @deprecated Use esc_js() |
|
2104 * @see esc_js() |
|
2105 * |
|
2106 * @param string $text The text to be escaped. |
|
2107 * @return string Escaped text. |
|
2108 */ |
|
2109 function js_escape( $text ) { |
|
2110 _deprecated_function( __FUNCTION__, '2.8', 'esc_js()' ); |
|
2111 return esc_js( $text ); |
|
2112 } |
|
2113 |
|
2114 /** |
|
2115 * Escaping for HTML blocks. |
|
2116 * |
|
2117 * @deprecated 2.8.0 |
|
2118 * @deprecated Use esc_html() |
|
2119 * @see esc_html() |
|
2120 */ |
|
2121 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { |
|
2122 _deprecated_function( __FUNCTION__, '2.8', 'esc_html()' ); |
|
2123 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args |
|
2124 $args = func_get_args(); |
|
2125 return call_user_func_array( '_wp_specialchars', $args ); |
|
2126 } else { |
|
2127 return esc_html( $string ); |
|
2128 } |
|
2129 } |
|
2130 |
|
2131 /** |
|
2132 * Escaping for HTML attributes. |
|
2133 * |
|
2134 * @since 2.0.6 |
|
2135 * @deprecated 2.8.0 |
|
2136 * @deprecated Use esc_attr() |
|
2137 * @see esc_attr() |
|
2138 * |
|
2139 * @param string $text |
|
2140 * @return string |
|
2141 */ |
|
2142 function attribute_escape( $text ) { |
|
2143 _deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' ); |
|
2144 return esc_attr( $text ); |
|
2145 } |
|
2146 |
|
2147 /** |
|
2148 * Register widget for sidebar with backwards compatibility. |
|
2149 * |
|
2150 * Allows $name to be an array that accepts either three elements to grab the |
|
2151 * first element and the third for the name or just uses the first element of |
|
2152 * the array for the name. |
|
2153 * |
|
2154 * Passes to {@link wp_register_sidebar_widget()} after argument list and |
|
2155 * backwards compatibility is complete. |
|
2156 * |
|
2157 * @since 2.2.0 |
|
2158 * @deprecated 2.8.0 |
|
2159 * @deprecated Use wp_register_sidebar_widget() |
|
2160 * @see wp_register_sidebar_widget() |
|
2161 * |
|
2162 * @param string|int $name Widget ID. |
|
2163 * @param callback $output_callback Run when widget is called. |
|
2164 * @param string $classname Classname widget option. |
|
2165 * @param mixed $params,... Widget parameters. |
|
2166 */ |
|
2167 function register_sidebar_widget($name, $output_callback, $classname = '') { |
|
2168 _deprecated_function( __FUNCTION__, '2.8', 'wp_register_sidebar_widget()' ); |
|
2169 // Compat |
|
2170 if ( is_array($name) ) { |
|
2171 if ( count($name) == 3 ) |
|
2172 $name = sprintf($name[0], $name[2]); |
|
2173 else |
|
2174 $name = $name[0]; |
|
2175 } |
|
2176 |
|
2177 $id = sanitize_title($name); |
|
2178 $options = array(); |
|
2179 if ( !empty($classname) && is_string($classname) ) |
|
2180 $options['classname'] = $classname; |
|
2181 $params = array_slice(func_get_args(), 2); |
|
2182 $args = array($id, $name, $output_callback, $options); |
|
2183 if ( !empty($params) ) |
|
2184 $args = array_merge($args, $params); |
|
2185 |
|
2186 call_user_func_array('wp_register_sidebar_widget', $args); |
|
2187 } |
|
2188 |
|
2189 /** |
|
2190 * Alias of {@link wp_unregister_sidebar_widget()}. |
|
2191 * |
|
2192 * @since 2.2.0 |
|
2193 * @deprecated 2.8.0 |
|
2194 * @deprecated Use wp_unregister_sidebar_widget() |
|
2195 * @see wp_unregister_sidebar_widget() |
|
2196 * |
|
2197 * @param int|string $id Widget ID. |
|
2198 */ |
|
2199 function unregister_sidebar_widget($id) { |
|
2200 _deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_sidebar_widget()' ); |
|
2201 return wp_unregister_sidebar_widget($id); |
|
2202 } |
|
2203 |
|
2204 /** |
|
2205 * Registers widget control callback for customizing options. |
|
2206 * |
|
2207 * Allows $name to be an array that accepts either three elements to grab the |
|
2208 * first element and the third for the name or just uses the first element of |
|
2209 * the array for the name. |
|
2210 * |
|
2211 * Passes to {@link wp_register_widget_control()} after the argument list has |
|
2212 * been compiled. |
|
2213 * |
|
2214 * @since 2.2.0 |
|
2215 * @deprecated 2.8.0 |
|
2216 * @deprecated Use wp_register_widget_control() |
|
2217 * @see wp_register_widget_control() |
|
2218 * |
|
2219 * @param int|string $name Sidebar ID. |
|
2220 * @param callback $control_callback Widget control callback to display and process form. |
|
2221 * @param int $width Widget width. |
|
2222 * @param int $height Widget height. |
|
2223 */ |
|
2224 function register_widget_control($name, $control_callback, $width = '', $height = '') { |
|
2225 _deprecated_function( __FUNCTION__, '2.8', 'wp_register_widget_control()' ); |
|
2226 // Compat |
|
2227 if ( is_array($name) ) { |
|
2228 if ( count($name) == 3 ) |
|
2229 $name = sprintf($name[0], $name[2]); |
|
2230 else |
|
2231 $name = $name[0]; |
|
2232 } |
|
2233 |
|
2234 $id = sanitize_title($name); |
|
2235 $options = array(); |
|
2236 if ( !empty($width) ) |
|
2237 $options['width'] = $width; |
|
2238 if ( !empty($height) ) |
|
2239 $options['height'] = $height; |
|
2240 $params = array_slice(func_get_args(), 4); |
|
2241 $args = array($id, $name, $control_callback, $options); |
|
2242 if ( !empty($params) ) |
|
2243 $args = array_merge($args, $params); |
|
2244 |
|
2245 call_user_func_array('wp_register_widget_control', $args); |
|
2246 } |
|
2247 |
|
2248 /** |
|
2249 * Alias of {@link wp_unregister_widget_control()}. |
|
2250 * |
|
2251 * @since 2.2.0 |
|
2252 * @deprecated 2.8.0 |
|
2253 * @deprecated Use wp_unregister_widget_control() |
|
2254 * @see wp_unregister_widget_control() |
|
2255 * |
|
2256 * @param int|string $id Widget ID. |
|
2257 */ |
|
2258 function unregister_widget_control($id) { |
|
2259 _deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_widget_control()' ); |
|
2260 return wp_unregister_widget_control($id); |
|
2261 } |
|
2262 |
|
2263 /** |
|
2264 * Remove user meta data. |
|
2265 * |
|
2266 * @since 2.0.0 |
|
2267 * @deprecated 3.0.0 |
|
2268 * @deprecated Use delete_user_meta() |
|
2269 * @see delete_user_meta() |
|
2270 * |
|
2271 * @param int $user_id User ID. |
|
2272 * @param string $meta_key Metadata key. |
|
2273 * @param mixed $meta_value Metadata value. |
|
2274 * @return bool True deletion completed and false if user_id is not a number. |
|
2275 */ |
|
2276 function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { |
|
2277 _deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' ); |
|
2278 global $wpdb; |
|
2279 if ( !is_numeric( $user_id ) ) |
|
2280 return false; |
|
2281 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); |
|
2282 |
|
2283 if ( is_array($meta_value) || is_object($meta_value) ) |
|
2284 $meta_value = serialize($meta_value); |
|
2285 $meta_value = trim( $meta_value ); |
|
2286 |
|
2287 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); |
|
2288 |
|
2289 if ( $cur && $cur->umeta_id ) |
|
2290 do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); |
|
2291 |
|
2292 if ( ! empty($meta_value) ) |
|
2293 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); |
|
2294 else |
|
2295 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); |
|
2296 |
|
2297 clean_user_cache( $user_id ); |
|
2298 wp_cache_delete( $user_id, 'user_meta' ); |
|
2299 |
|
2300 if ( $cur && $cur->umeta_id ) |
|
2301 do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); |
|
2302 |
|
2303 return true; |
|
2304 } |
|
2305 |
|
2306 /** |
|
2307 * Retrieve user metadata. |
|
2308 * |
|
2309 * If $user_id is not a number, then the function will fail over with a 'false' |
|
2310 * boolean return value. Other returned values depend on whether there is only |
|
2311 * one item to be returned, which be that single item type. If there is more |
|
2312 * than one metadata value, then it will be list of metadata values. |
|
2313 * |
|
2314 * @since 2.0.0 |
|
2315 * @deprecated 3.0.0 |
|
2316 * @deprecated Use get_user_meta() |
|
2317 * @see get_user_meta() |
|
2318 * |
|
2319 * @param int $user_id User ID |
|
2320 * @param string $meta_key Optional. Metadata key. |
|
2321 * @return mixed |
|
2322 */ |
|
2323 function get_usermeta( $user_id, $meta_key = '' ) { |
|
2324 _deprecated_function( __FUNCTION__, '3.0', 'get_user_meta()' ); |
|
2325 global $wpdb; |
|
2326 $user_id = (int) $user_id; |
|
2327 |
|
2328 if ( !$user_id ) |
|
2329 return false; |
|
2330 |
|
2331 if ( !empty($meta_key) ) { |
|
2332 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); |
|
2333 $user = wp_cache_get($user_id, 'users'); |
|
2334 // Check the cached user object |
|
2335 if ( false !== $user && isset($user->$meta_key) ) |
|
2336 $metas = array($user->$meta_key); |
|
2337 else |
|
2338 $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); |
|
2339 } else { |
|
2340 $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) ); |
|
2341 } |
|
2342 |
|
2343 if ( empty($metas) ) { |
|
2344 if ( empty($meta_key) ) |
|
2345 return array(); |
|
2346 else |
|
2347 return ''; |
|
2348 } |
|
2349 |
|
2350 $metas = array_map('maybe_unserialize', $metas); |
|
2351 |
|
2352 if ( count($metas) == 1 ) |
|
2353 return $metas[0]; |
|
2354 else |
|
2355 return $metas; |
|
2356 } |
|
2357 |
|
2358 /** |
|
2359 * Update metadata of user. |
|
2360 * |
|
2361 * There is no need to serialize values, they will be serialized if it is |
|
2362 * needed. The metadata key can only be a string with underscores. All else will |
|
2363 * be removed. |
|
2364 * |
|
2365 * Will remove the metadata, if the meta value is empty. |
|
2366 * |
|
2367 * @since 2.0.0 |
|
2368 * @deprecated 3.0.0 |
|
2369 * @deprecated Use update_user_meta() |
|
2370 * @see update_user_meta() |
|
2371 * |
|
2372 * @param int $user_id User ID |
|
2373 * @param string $meta_key Metadata key. |
|
2374 * @param mixed $meta_value Metadata value. |
|
2375 * @return bool True on successful update, false on failure. |
|
2376 */ |
|
2377 function update_usermeta( $user_id, $meta_key, $meta_value ) { |
|
2378 _deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' ); |
|
2379 global $wpdb; |
|
2380 if ( !is_numeric( $user_id ) ) |
|
2381 return false; |
|
2382 $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); |
|
2383 |
|
2384 /** @todo Might need fix because usermeta data is assumed to be already escaped */ |
|
2385 if ( is_string($meta_value) ) |
|
2386 $meta_value = stripslashes($meta_value); |
|
2387 $meta_value = maybe_serialize($meta_value); |
|
2388 |
|
2389 if (empty($meta_value)) { |
|
2390 return delete_usermeta($user_id, $meta_key); |
|
2391 } |
|
2392 |
|
2393 $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); |
|
2394 |
|
2395 if ( $cur ) |
|
2396 do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); |
|
2397 |
|
2398 if ( !$cur ) |
|
2399 $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); |
|
2400 else if ( $cur->meta_value != $meta_value ) |
|
2401 $wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') ); |
|
2402 else |
|
2403 return false; |
|
2404 |
|
2405 clean_user_cache( $user_id ); |
|
2406 wp_cache_delete( $user_id, 'user_meta' ); |
|
2407 |
|
2408 if ( !$cur ) |
|
2409 do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); |
|
2410 else |
|
2411 do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); |
|
2412 |
|
2413 return true; |
|
2414 } |
|
2415 |
|
2416 /** |
|
2417 * Get users for the blog. |
|
2418 * |
|
2419 * For setups that use the multi-blog feature. Can be used outside of the |
|
2420 * multi-blog feature. |
|
2421 * |
|
2422 * @since 2.2.0 |
|
2423 * @deprecated 3.1.0 |
|
2424 * @uses $wpdb WordPress database object for queries |
|
2425 * @uses $blog_id The Blog id of the blog for those that use more than one blog |
|
2426 * |
|
2427 * @param int $id Blog ID. |
|
2428 * @return array List of users that are part of that Blog ID |
|
2429 */ |
|
2430 function get_users_of_blog( $id = '' ) { |
|
2431 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' ); |
|
2432 |
|
2433 global $wpdb, $blog_id; |
|
2434 if ( empty($id) ) |
|
2435 $id = (int) $blog_id; |
|
2436 $blog_prefix = $wpdb->get_blog_prefix($id); |
|
2437 $users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); |
|
2438 return $users; |
|
2439 } |
|
2440 |
|
2441 /** |
|
2442 * Enable/disable automatic general feed link outputting. |
|
2443 * |
|
2444 * @since 2.8.0 |
|
2445 * @deprecated 3.0.0 |
|
2446 * @deprecated Use add_theme_support( 'automatic-feed-links' ) |
|
2447 * |
|
2448 * @param boolean $add Optional, default is true. Add or remove links. Defaults to true. |
|
2449 */ |
|
2450 function automatic_feed_links( $add = true ) { |
|
2451 _deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" ); |
|
2452 |
|
2453 if ( $add ) |
|
2454 add_theme_support( 'automatic-feed-links' ); |
|
2455 else |
|
2456 remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+ |
|
2457 } |
|
2458 |
|
2459 /** |
|
2460 * Retrieve user data based on field. |
|
2461 * |
|
2462 * @since 1.5.0 |
|
2463 * @deprecated 3.0.0 |
|
2464 * @deprecated Use get_the_author_meta() |
|
2465 * @see get_the_author_meta() |
|
2466 */ |
|
2467 function get_profile( $field, $user = false ) { |
|
2468 _deprecated_function( __FUNCTION__, '3.0', 'get_the_author_meta()' ); |
|
2469 if ( $user ) { |
|
2470 $user = get_user_by( 'login', $user ); |
|
2471 $user = $user->ID; |
|
2472 } |
|
2473 return get_the_author_meta( $field, $user ); |
|
2474 } |
|
2475 |
|
2476 /** |
|
2477 * Number of posts user has written. |
|
2478 * |
|
2479 * @since 0.71 |
|
2480 * @deprecated 3.0.0 |
|
2481 * @deprecated Use count_user_posts() |
|
2482 * @see count_user_posts() |
|
2483 */ |
|
2484 function get_usernumposts( $userid ) { |
|
2485 _deprecated_function( __FUNCTION__, '3.0', 'count_user_posts()' ); |
|
2486 return count_user_posts( $userid ); |
|
2487 } |
|
2488 |
|
2489 /** |
|
2490 * Callback used to change %uXXXX to &#YYY; syntax |
|
2491 * |
|
2492 * @since 2.8.0 |
|
2493 * @access private |
|
2494 * @deprecated 3.0.0 |
|
2495 * |
|
2496 * @param array $matches Single Match |
|
2497 * @return string An HTML entity |
|
2498 */ |
|
2499 function funky_javascript_callback($matches) { |
|
2500 return "&#".base_convert($matches[1],16,10).";"; |
|
2501 } |
|
2502 |
|
2503 /** |
|
2504 * Fixes javascript bugs in browsers. |
|
2505 * |
|
2506 * Converts unicode characters to HTML numbered entities. |
|
2507 * |
|
2508 * @since 1.5.0 |
|
2509 * @uses $is_macIE |
|
2510 * @uses $is_winIE |
|
2511 * @deprecated 3.0.0 |
|
2512 * |
|
2513 * @param string $text Text to be made safe. |
|
2514 * @return string Fixed text. |
|
2515 */ |
|
2516 function funky_javascript_fix($text) { |
|
2517 _deprecated_function( __FUNCTION__, '3.0' ); |
|
2518 // Fixes for browsers' javascript bugs |
|
2519 global $is_macIE, $is_winIE; |
|
2520 |
|
2521 if ( $is_winIE || $is_macIE ) |
|
2522 $text = preg_replace_callback("/\%u([0-9A-F]{4,4})/", |
|
2523 "funky_javascript_callback", |
|
2524 $text); |
|
2525 |
|
2526 return $text; |
|
2527 } |
|
2528 |
|
2529 /** |
|
2530 * Checks that the taxonomy name exists. |
|
2531 * |
|
2532 * @since 2.3.0 |
|
2533 * @deprecated 3.0.0 |
|
2534 * @deprecated Use taxonomy_exists() |
|
2535 * @see taxonomy_exists() |
|
2536 * |
|
2537 * @param string $taxonomy Name of taxonomy object |
|
2538 * @return bool Whether the taxonomy exists. |
|
2539 */ |
|
2540 function is_taxonomy( $taxonomy ) { |
|
2541 _deprecated_function( __FUNCTION__, '3.0', 'taxonomy_exists()' ); |
|
2542 return taxonomy_exists( $taxonomy ); |
|
2543 } |
|
2544 |
|
2545 /** |
|
2546 * Check if Term exists. |
|
2547 * |
|
2548 * @since 2.3.0 |
|
2549 * @deprecated 3.0.0 |
|
2550 * @deprecated Use term_exists() |
|
2551 * @see term_exists() |
|
2552 * |
|
2553 * @param int|string $term The term to check |
|
2554 * @param string $taxonomy The taxonomy name to use |
|
2555 * @param int $parent ID of parent term under which to confine the exists search. |
|
2556 * @return mixed Get the term id or Term Object, if exists. |
|
2557 */ |
|
2558 function is_term( $term, $taxonomy = '', $parent = 0 ) { |
|
2559 _deprecated_function( __FUNCTION__, '3.0', 'term_exists()' ); |
|
2560 return term_exists( $term, $taxonomy, $parent ); |
|
2561 } |
|
2562 |
|
2563 /** |
|
2564 * Is the current admin page generated by a plugin? |
|
2565 * |
|
2566 * @since 1.5.0 |
|
2567 * @deprecated 3.1.0 |
|
2568 * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks. |
|
2569 * |
|
2570 * @global $plugin_page |
|
2571 * |
|
2572 * @return bool |
|
2573 */ |
|
2574 function is_plugin_page() { |
|
2575 _deprecated_function( __FUNCTION__, '3.1' ); |
|
2576 |
|
2577 global $plugin_page; |
|
2578 |
|
2579 if ( isset($plugin_page) ) |
|
2580 return true; |
|
2581 |
|
2582 return false; |
|
2583 } |
|
2584 |
|
2585 /** |
|
2586 * Update the categories cache. |
|
2587 * |
|
2588 * This function does not appear to be used anymore or does not appear to be |
|
2589 * needed. It might be a legacy function left over from when there was a need |
|
2590 * for updating the category cache. |
|
2591 * |
|
2592 * @since 1.5.0 |
|
2593 * @deprecated 3.1.0 |
|
2594 * |
|
2595 * @return bool Always return True |
|
2596 */ |
|
2597 function update_category_cache() { |
|
2598 _deprecated_function( __FUNCTION__, '3.1' ); |
|
2599 |
|
2600 return true; |
|
2601 } |
|
2602 |
|
2603 /** |
|
2604 * Check for PHP timezone support |
|
2605 * |
|
2606 * @since 2.9.0 |
|
2607 * @deprecated 3.2.0 |
|
2608 * |
|
2609 * @return bool |
|
2610 */ |
|
2611 function wp_timezone_supported() { |
|
2612 _deprecated_function( __FUNCTION__, '3.2' ); |
|
2613 |
|
2614 return true; |
|
2615 } |
|
2616 |
|
2617 /** |
|
2618 * Display editor: TinyMCE, HTML, or both. |
|
2619 * |
|
2620 * @since 2.1.0 |
|
2621 * @deprecated 3.3.0 |
|
2622 * @deprecated Use wp_editor() |
|
2623 * @see wp_editor() |
|
2624 * |
|
2625 * @param string $content Textarea content. |
|
2626 * @param string $id Optional, default is 'content'. HTML ID attribute value. |
|
2627 * @param string $prev_id Optional, not used |
|
2628 * @param bool $media_buttons Optional, default is true. Whether to display media buttons. |
|
2629 * @param int $tab_index Optional, not used |
|
2630 */ |
|
2631 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) { |
|
2632 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
|
2633 |
|
2634 wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) ); |
|
2635 return; |
|
2636 } |
|
2637 |
|
2638 /** |
|
2639 * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users |
|
2640 * |
|
2641 * @since 3.0.0 |
|
2642 * @deprecated 3.3.0 |
|
2643 * |
|
2644 * @param array $ids User ID numbers list. |
|
2645 * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays. |
|
2646 */ |
|
2647 function get_user_metavalues($ids) { |
|
2648 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2649 |
|
2650 $objects = array(); |
|
2651 |
|
2652 $ids = array_map('intval', $ids); |
|
2653 foreach ( $ids as $id ) |
|
2654 $objects[$id] = array(); |
|
2655 |
|
2656 $metas = update_meta_cache('user', $ids); |
|
2657 |
|
2658 foreach ( $metas as $id => $meta ) { |
|
2659 foreach ( $meta as $key => $metavalues ) { |
|
2660 foreach ( $metavalues as $value ) { |
|
2661 $objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value); |
|
2662 } |
|
2663 } |
|
2664 } |
|
2665 |
|
2666 return $objects; |
|
2667 } |
|
2668 |
|
2669 /** |
|
2670 * Sanitize every user field. |
|
2671 * |
|
2672 * If the context is 'raw', then the user object or array will get minimal santization of the int fields. |
|
2673 * |
|
2674 * @since 2.3.0 |
|
2675 * @deprecated 3.3.0 |
|
2676 * |
|
2677 * @param object|array $user The User Object or Array |
|
2678 * @param string $context Optional, default is 'display'. How to sanitize user fields. |
|
2679 * @return object|array The now sanitized User Object or Array (will be the same type as $user) |
|
2680 */ |
|
2681 function sanitize_user_object($user, $context = 'display') { |
|
2682 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2683 |
|
2684 if ( is_object($user) ) { |
|
2685 if ( !isset($user->ID) ) |
|
2686 $user->ID = 0; |
|
2687 if ( !is_a( $user, 'WP_User' ) ) { |
|
2688 $vars = get_object_vars($user); |
|
2689 foreach ( array_keys($vars) as $field ) { |
|
2690 if ( is_string($user->$field) || is_numeric($user->$field) ) |
|
2691 $user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context); |
|
2692 } |
|
2693 } |
|
2694 $user->filter = $context; |
|
2695 } else { |
|
2696 if ( !isset($user['ID']) ) |
|
2697 $user['ID'] = 0; |
|
2698 foreach ( array_keys($user) as $field ) |
|
2699 $user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context); |
|
2700 $user['filter'] = $context; |
|
2701 } |
|
2702 |
|
2703 return $user; |
|
2704 } |
|
2705 |
|
2706 /** |
|
2707 * Get boundary post relational link. |
|
2708 * |
|
2709 * Can either be start or end post relational link. |
|
2710 * |
|
2711 * @since 2.8.0 |
|
2712 * @deprecated 3.3.0 |
|
2713 * |
|
2714 * @param string $title Optional. Link title format. |
|
2715 * @param bool $in_same_cat Optional. Whether link should be in a same category. |
|
2716 * @param string $excluded_categories Optional. Excluded categories IDs. |
|
2717 * @param bool $start Optional, default is true. Whether to display link to first or last post. |
|
2718 * @return string |
|
2719 */ |
|
2720 function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) { |
|
2721 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2722 |
|
2723 $posts = get_boundary_post($in_same_cat, $excluded_categories, $start); |
|
2724 // If there is no post stop. |
|
2725 if ( empty($posts) ) |
|
2726 return; |
|
2727 |
|
2728 // Even though we limited get_posts to return only 1 item it still returns an array of objects. |
|
2729 $post = $posts[0]; |
|
2730 |
|
2731 if ( empty($post->post_title) ) |
|
2732 $post->post_title = $start ? __('First Post') : __('Last Post'); |
|
2733 |
|
2734 $date = mysql2date(get_option('date_format'), $post->post_date); |
|
2735 |
|
2736 $title = str_replace('%title', $post->post_title, $title); |
|
2737 $title = str_replace('%date', $date, $title); |
|
2738 $title = apply_filters('the_title', $title, $post->ID); |
|
2739 |
|
2740 $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; |
|
2741 $link .= esc_attr($title); |
|
2742 $link .= "' href='" . get_permalink($post) . "' />\n"; |
|
2743 |
|
2744 $boundary = $start ? 'start' : 'end'; |
|
2745 return apply_filters( "{$boundary}_post_rel_link", $link ); |
|
2746 } |
|
2747 |
|
2748 /** |
|
2749 * Display relational link for the first post. |
|
2750 * |
|
2751 * @since 2.8.0 |
|
2752 * @deprecated 3.3.0 |
|
2753 * |
|
2754 * @param string $title Optional. Link title format. |
|
2755 * @param bool $in_same_cat Optional. Whether link should be in a same category. |
|
2756 * @param string $excluded_categories Optional. Excluded categories IDs. |
|
2757 */ |
|
2758 function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') { |
|
2759 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2760 |
|
2761 echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true); |
|
2762 } |
|
2763 |
|
2764 /** |
|
2765 * Get site index relational link. |
|
2766 * |
|
2767 * @since 2.8.0 |
|
2768 * @deprecated 3.3.0 |
|
2769 * |
|
2770 * @return string |
|
2771 */ |
|
2772 function get_index_rel_link() { |
|
2773 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2774 |
|
2775 $link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n"; |
|
2776 return apply_filters( "index_rel_link", $link ); |
|
2777 } |
|
2778 |
|
2779 /** |
|
2780 * Display relational link for the site index. |
|
2781 * |
|
2782 * @since 2.8.0 |
|
2783 * @deprecated 3.3.0 |
|
2784 */ |
|
2785 function index_rel_link() { |
|
2786 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2787 |
|
2788 echo get_index_rel_link(); |
|
2789 } |
|
2790 |
|
2791 /** |
|
2792 * Get parent post relational link. |
|
2793 * |
|
2794 * @since 2.8.0 |
|
2795 * @deprecated 3.3.0 |
|
2796 * |
|
2797 * @param string $title Optional. Link title format. |
|
2798 * @return string |
|
2799 */ |
|
2800 function get_parent_post_rel_link($title = '%title') { |
|
2801 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2802 |
|
2803 if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) ) |
|
2804 $post = & get_post($GLOBALS['post']->post_parent); |
|
2805 |
|
2806 if ( empty($post) ) |
|
2807 return; |
|
2808 |
|
2809 $date = mysql2date(get_option('date_format'), $post->post_date); |
|
2810 |
|
2811 $title = str_replace('%title', $post->post_title, $title); |
|
2812 $title = str_replace('%date', $date, $title); |
|
2813 $title = apply_filters('the_title', $title, $post->ID); |
|
2814 |
|
2815 $link = "<link rel='up' title='"; |
|
2816 $link .= esc_attr( $title ); |
|
2817 $link .= "' href='" . get_permalink($post) . "' />\n"; |
|
2818 |
|
2819 return apply_filters( "parent_post_rel_link", $link ); |
|
2820 } |
|
2821 |
|
2822 /** |
|
2823 * Display relational link for parent item |
|
2824 * |
|
2825 * @since 2.8.0 |
|
2826 * @deprecated 3.3.0 |
|
2827 */ |
|
2828 function parent_post_rel_link($title = '%title') { |
|
2829 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2830 |
|
2831 echo get_parent_post_rel_link($title); |
|
2832 } |
|
2833 |
|
2834 /** |
|
2835 * Add the "Dashboard"/"Visit Site" menu. |
|
2836 * |
|
2837 * @since 3.2.0 |
|
2838 * @deprecated 3.3.0 |
|
2839 */ |
|
2840 function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) { |
|
2841 _deprecated_function( __FUNCTION__, '3.3' ); |
|
2842 |
|
2843 $user_id = get_current_user_id(); |
|
2844 |
|
2845 if ( 0 != $user_id ) { |
|
2846 if ( is_admin() ) |
|
2847 $wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) ); |
|
2848 elseif ( is_multisite() ) |
|
2849 $wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) ); |
|
2850 else |
|
2851 $wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) ); |
|
2852 } |
|
2853 } |
|
2854 |
|
2855 /** |
|
2856 * Checks if the current user belong to a given blog. |
|
2857 * |
|
2858 * @since MU |
|
2859 * @deprecated 3.3.0 |
|
2860 * @deprecated Use is_user_member_of_blog() |
|
2861 * @see is_user_member_of_blog() |
|
2862 * |
|
2863 * @param int $blog_id Blog ID |
|
2864 * @return bool True if the current users belong to $blog_id, false if not. |
|
2865 */ |
|
2866 function is_blog_user( $blog_id = 0 ) { |
|
2867 _deprecated_function( __FUNCTION__, '3.3', 'is_user_member_of_blog()' ); |
|
2868 |
|
2869 return is_user_member_of_blog( get_current_user_id(), $blog_id ); |
|
2870 } |
|
2871 |
|
2872 /** |
|
2873 * Open the file handle for debugging. |
|
2874 * |
|
2875 * @since 0.71 |
|
2876 * @deprecated Use error_log() |
|
2877 * @link http://www.php.net/manual/en/function.error-log.php |
|
2878 * @deprecated 3.4.0 |
|
2879 */ |
|
2880 function debug_fopen( $filename, $mode ) { |
|
2881 _deprecated_function( __FUNCTION__, 'error_log()' ); |
|
2882 return false; |
|
2883 } |
|
2884 |
|
2885 /** |
|
2886 * Write contents to the file used for debugging. |
|
2887 * |
|
2888 * @since 0.71 |
|
2889 * @deprecated Use error_log() instead. |
|
2890 * @link http://www.php.net/manual/en/function.error-log.php |
|
2891 * @deprecated 3.4.0 |
|
2892 */ |
|
2893 function debug_fwrite( $fp, $string ) { |
|
2894 _deprecated_function( __FUNCTION__, 'error_log()' ); |
|
2895 if ( ! empty( $GLOBALS['debug'] ) ) |
|
2896 error_log( $string ); |
|
2897 } |
|
2898 |
|
2899 /** |
|
2900 * Close the debugging file handle. |
|
2901 * |
|
2902 * @since 0.71 |
|
2903 * @deprecated Use error_log() |
|
2904 * @link http://www.php.net/manual/en/function.error-log.php |
|
2905 * @deprecated 3.4.0 |
|
2906 */ |
|
2907 function debug_fclose( $fp ) { |
|
2908 _deprecated_function( __FUNCTION__, 'error_log()' ); |
|
2909 } |
|
2910 |
|
2911 /** |
|
2912 * Retrieve list of themes with theme data in theme directory. |
|
2913 * |
|
2914 * The theme is broken, if it doesn't have a parent theme and is missing either |
|
2915 * style.css and, or index.php. If the theme has a parent theme then it is |
|
2916 * broken, if it is missing style.css; index.php is optional. |
|
2917 * |
|
2918 * @since 1.5.0 |
|
2919 * @deprecated 3.4.0 |
|
2920 * @deprecated Use wp_get_themes() |
|
2921 * @see wp_get_themes() |
|
2922 * |
|
2923 * @return array Theme list with theme data. |
|
2924 */ |
|
2925 function get_themes() { |
|
2926 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_themes()' ); |
|
2927 |
|
2928 global $wp_themes; |
|
2929 if ( isset( $wp_themes ) ) |
|
2930 return $wp_themes; |
|
2931 |
|
2932 $themes = wp_get_themes(); |
|
2933 $wp_themes = array(); |
|
2934 |
|
2935 foreach ( $themes as $theme ) { |
|
2936 $name = $theme->get('Name'); |
|
2937 if ( isset( $wp_themes[ $name ] ) ) |
|
2938 $wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme; |
|
2939 else |
|
2940 $wp_themes[ $name ] = $theme; |
|
2941 } |
|
2942 |
|
2943 return $wp_themes; |
|
2944 } |
|
2945 |
|
2946 /** |
|
2947 * Retrieve theme data. |
|
2948 * |
|
2949 * @since 1.5.0 |
|
2950 * @deprecated 3.4.0 |
|
2951 * @deprecated Use wp_get_theme() |
|
2952 * @see wp_get_theme() |
|
2953 * |
|
2954 * @param string $theme Theme name. |
|
2955 * @return array|null Null, if theme name does not exist. Theme data, if exists. |
|
2956 */ |
|
2957 function get_theme( $theme ) { |
|
2958 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' ); |
|
2959 |
|
2960 $themes = get_themes(); |
|
2961 if ( is_array( $themes ) && array_key_exists( $theme, $themes ) ) |
|
2962 return $themes[ $theme ]; |
|
2963 return null; |
|
2964 } |
|
2965 |
|
2966 /** |
|
2967 * Retrieve current theme name. |
|
2968 * |
|
2969 * @since 1.5.0 |
|
2970 * @deprecated 3.4.0 |
|
2971 * @deprecated Use (string) wp_get_theme() |
|
2972 * @see wp_get_theme() |
|
2973 * |
|
2974 * @return string |
|
2975 */ |
|
2976 function get_current_theme() { |
|
2977 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' ); |
|
2978 |
|
2979 if ( $theme = get_option( 'current_theme' ) ) |
|
2980 return $theme; |
|
2981 |
|
2982 return wp_get_theme()->get('Name'); |
|
2983 } |
|
2984 |
|
2985 /** |
|
2986 * Accepts matches array from preg_replace_callback in wpautop() or a string. |
|
2987 * |
|
2988 * Ensures that the contents of a <<pre>>...<</pre>> HTML block are not |
|
2989 * converted into paragraphs or line-breaks. |
|
2990 * |
|
2991 * @since 1.2.0 |
|
2992 * @deprecated 3.4.0 |
|
2993 * |
|
2994 * @param array|string $matches The array or string |
|
2995 * @return string The pre block without paragraph/line-break conversion. |
|
2996 */ |
|
2997 function clean_pre($matches) { |
|
2998 _deprecated_function( __FUNCTION__, '3.4' ); |
|
2999 |
|
3000 if ( is_array($matches) ) |
|
3001 $text = $matches[1] . $matches[2] . "</pre>"; |
|
3002 else |
|
3003 $text = $matches; |
|
3004 |
|
3005 $text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text); |
|
3006 $text = str_replace('<p>', "\n", $text); |
|
3007 $text = str_replace('</p>', '', $text); |
|
3008 |
|
3009 return $text; |
|
3010 } |
|
3011 |
|
3012 |
|
3013 /** |
|
3014 * Add callbacks for image header display. |
|
3015 * |
|
3016 * @since 2.1.0 |
|
3017 * @deprecated 3.4.0 |
|
3018 * @deprecated Use add_theme_support('custom-header', $args) |
|
3019 * @see add_theme_support() |
|
3020 * |
|
3021 * @param callback $wp_head_callback Call on 'wp_head' action. |
|
3022 * @param callback $admin_head_callback Call on custom header administration screen. |
|
3023 * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional. |
|
3024 */ |
|
3025 function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) { |
|
3026 _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' ); |
|
3027 $args = array( |
|
3028 'wp-head-callback' => $wp_head_callback, |
|
3029 'admin-head-callback' => $admin_head_callback, |
|
3030 ); |
|
3031 if ( $admin_preview_callback ) |
|
3032 $args['admin-preview-callback'] = $admin_preview_callback; |
|
3033 return add_theme_support( 'custom-header', $args ); |
|
3034 } |
|
3035 |
|
3036 /** |
|
3037 * Remove image header support. |
|
3038 * |
|
3039 * @since 3.1.0 |
|
3040 * @deprecated 3.4.0 |
|
3041 * @deprecated Use remove_theme_support('custom-header') |
|
3042 * @see remove_theme_support() |
|
3043 * |
|
3044 * @return bool Whether support was removed. |
|
3045 */ |
|
3046 function remove_custom_image_header() { |
|
3047 _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-header\' )' ); |
|
3048 return remove_theme_support( 'custom-header' ); |
|
3049 } |
|
3050 |
|
3051 /** |
|
3052 * Add callbacks for background image display. |
|
3053 * |
|
3054 * @since 3.0.0 |
|
3055 * @deprecated 3.4.0 |
|
3056 * @deprecated Use add_theme_support('custom-background, $args) |
|
3057 * @see add_theme_support() |
|
3058 * |
|
3059 * @param callback $wp_head_callback Call on 'wp_head' action. |
|
3060 * @param callback $admin_head_callback Call on custom background administration screen. |
|
3061 * @param callback $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional. |
|
3062 */ |
|
3063 function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) { |
|
3064 _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' ); |
|
3065 $args = array(); |
|
3066 if ( $wp_head_callback ) |
|
3067 $args['wp-head-callback'] = $wp_head_callback; |
|
3068 if ( $admin_head_callback ) |
|
3069 $args['admin-head-callback'] = $admin_head_callback; |
|
3070 if ( $admin_preview_callback ) |
|
3071 $args['admin-preview-callback'] = $admin_preview_callback; |
|
3072 return add_theme_support( 'custom-background', $args ); |
|
3073 } |
|
3074 |
|
3075 /** |
|
3076 * Remove custom background support. |
|
3077 * |
|
3078 * @since 3.1.0 |
|
3079 * @see add_custom_background() |
|
3080 * |
|
3081 * @return bool Whether support was removed. |
|
3082 */ |
|
3083 function remove_custom_background() { |
|
3084 _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-background\' )' ); |
|
3085 return remove_theme_support( 'custom-background' ); |
|
3086 } |
|
3087 |
|
3088 /** |
|
3089 * Retrieve theme data from parsed theme file. |
|
3090 * |
|
3091 * @since 1.5.0 |
|
3092 * @deprecated 3.4.0 |
|
3093 * @deprecated Use wp_get_theme() |
|
3094 * @see wp_get_theme() |
|
3095 * |
|
3096 * @param string $theme_file Theme file path. |
|
3097 * @return array Theme data. |
|
3098 */ |
|
3099 function get_theme_data( $theme_file ) { |
|
3100 _deprecated_function( __FUNCTION__, 3.4, 'wp_get_theme()' ); |
|
3101 $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) ); |
|
3102 |
|
3103 $theme_data = array( |
|
3104 'Name' => $theme->get('Name'), |
|
3105 'URI' => $theme->display('ThemeURI', true, false), |
|
3106 'Description' => $theme->display('Description', true, false), |
|
3107 'Author' => $theme->display('Author', true, false), |
|
3108 'AuthorURI' => $theme->display('AuthorURI', true, false), |
|
3109 'Version' => $theme->get('Version'), |
|
3110 'Template' => $theme->get('Template'), |
|
3111 'Status' => $theme->get('Status'), |
|
3112 'Tags' => $theme->get('Tags'), |
|
3113 'Title' => $theme->get('Name'), |
|
3114 'AuthorName' => $theme->get('Author'), |
|
3115 ); |
|
3116 |
|
3117 foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) { |
|
3118 if ( ! isset( $theme_data[ $extra_header ] ) ) |
|
3119 $theme_data[ $extra_header ] = $theme->get( $extra_header ); |
|
3120 } |
|
3121 |
|
3122 return $theme_data; |
|
3123 } |
|
3124 |
|
3125 /** |
|
3126 * Alias of update_post_cache(). |
|
3127 * |
|
3128 * @see update_post_cache() Posts and pages are the same, alias is intentional |
|
3129 * |
|
3130 * @since 1.5.1 |
|
3131 * @deprecated 3.4.0 |
|
3132 * |
|
3133 * @param array $pages list of page objects |
|
3134 */ |
|
3135 function update_page_cache( &$pages ) { |
|
3136 _deprecated_function( __FUNCTION__, 3.4, 'update_post_cache()' ); |
|
3137 |
|
3138 update_post_cache( $pages ); |
|
3139 } |
|
3140 |
|
3141 /** |
|
3142 * Will clean the page in the cache. |
|
3143 * |
|
3144 * Clean (read: delete) page from cache that matches $id. Will also clean cache |
|
3145 * associated with 'all_page_ids' and 'get_pages'. |
|
3146 * |
|
3147 * @since 2.0.0 |
|
3148 * @deprecated 3.4.0 |
|
3149 * |
|
3150 * @uses do_action() Will call the 'clean_page_cache' hook action. |
|
3151 * |
|
3152 * @param int $id Page ID to clean |
|
3153 */ |
|
3154 function clean_page_cache( $id ) { |
|
3155 _deprecated_function( __FUNCTION__, 3.4, 'clean_post_cache()' ); |
|
3156 |
|
3157 clean_post_cache( $id ); |
|
3158 } |