]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/includes/deprecated.php
WordPress 4.2.4
[autoinstalls/wordpress.git] / wp-admin / includes / deprecated.php
1 <?php
2 /**
3  * Deprecated admin functions from past WordPress versions. You shouldn't use these
4  * functions and look for the alternatives instead. The functions will be removed
5  * in a later version.
6  *
7  * @package WordPress
8  * @subpackage Deprecated
9  */
10
11 /*
12  * Deprecated functions come here to die.
13  */
14
15 /**
16  * @since 2.1.0
17  * @deprecated 2.1.0
18  * @deprecated Use wp_editor().
19  * @see wp_editor()
20  */
21 function tinymce_include() {
22         _deprecated_function( __FUNCTION__, '2.1', 'wp_editor()' );
23
24         wp_tiny_mce();
25 }
26
27 /**
28  * Unused Admin function.
29  *
30  * @since 2.0.0
31  * @deprecated 2.5.0
32  *
33  */
34 function documentation_link() {
35         _deprecated_function( __FUNCTION__, '2.5' );
36 }
37
38 /**
39  * Calculates the new dimensions for a downsampled image.
40  *
41  * @since 2.0.0
42  * @deprecated 3.0.0
43  * @deprecated Use wp_constrain_dimensions()
44  * @see wp_constrain_dimensions()
45  *
46  * @param int $width Current width of the image
47  * @param int $height Current height of the image
48  * @param int $wmax Maximum wanted width
49  * @param int $hmax Maximum wanted height
50  * @return array Shrunk dimensions (width, height).
51  */
52 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
53         _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );
54         return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
55 }
56
57 /**
58  * Calculated the new dimensions for a downsampled image.
59  *
60  * @since 2.0.0
61  * @deprecated 3.5.0
62  * @deprecated Use wp_constrain_dimensions()
63  * @see wp_constrain_dimensions()
64  *
65  * @param int $width Current width of the image
66  * @param int $height Current height of the image
67  * @return array Shrunk dimensions (width, height).
68  */
69 function get_udims( $width, $height ) {
70         _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' );
71         return wp_constrain_dimensions( $width, $height, 128, 96 );
72 }
73
74 /**
75  * {@internal Missing Short Description}}
76  *
77  * @since 0.71
78  * @deprecated 2.6.0
79  * @deprecated Use wp_category_checklist()
80  * @see wp_category_checklist()
81  *
82  * @param int $default
83  * @param int $parent
84  * @param array $popular_ids
85  */
86 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
87         _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' );
88         global $post_ID;
89         wp_category_checklist( $post_ID );
90 }
91
92 /**
93  * {@internal Missing Short Description}}
94  *
95  * @since 2.1.0
96  * @deprecated 2.6.0
97  * @deprecated Use wp_link_category_checklist()
98  * @see wp_link_category_checklist()
99  *
100  * @param int $default
101  */
102 function dropdown_link_categories( $default = 0 ) {
103         _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' );
104         global $link_id;
105         wp_link_category_checklist( $link_id );
106 }
107
108 /**
109  * Get the real filesystem path to a file to edit within the admin.
110  *
111  * @since 1.5.0
112  * @deprecated 2.9.0
113  * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
114  *
115  * @param string $file Filesystem path relative to the wp-content directory.
116  * @return string Full filesystem path to edit.
117  */
118 function get_real_file_to_edit( $file ) {
119         _deprecated_function( __FUNCTION__, '2.9' );
120
121         return WP_CONTENT_DIR . $file;
122 }
123
124 /**
125  * {@internal Missing Short Description}}
126  *
127  * @since 1.2.0
128  * @deprecated 3.0.0
129  * @deprecated Use wp_dropdown_categories()
130  * @see wp_dropdown_categories()
131  *
132  * @param int $currentcat
133  * @param int $currentparent
134  * @param int $parent
135  * @param int $level
136  * @param array $categories
137  * @return bool|null
138  */
139 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
140         _deprecated_function( __FUNCTION__, '3.0', 'wp_dropdown_categories()' );
141         if (!$categories )
142                 $categories = get_categories( array('hide_empty' => 0) );
143
144         if ( $categories ) {
145                 foreach ( $categories as $category ) {
146                         if ( $currentcat != $category->term_id && $parent == $category->parent) {
147                                 $pad = str_repeat( '&#8211; ', $level );
148                                 $category->name = esc_html( $category->name );
149                                 echo "\n\t<option value='$category->term_id'";
150                                 if ( $currentparent == $category->term_id )
151                                         echo " selected='selected'";
152                                 echo ">$pad$category->name</option>";
153                                 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
154                         }
155                 }
156         } else {
157                 return false;
158         }
159 }
160
161 /**
162  * Register a setting and its sanitization callback
163  *
164  * @since 2.7.0
165  * @deprecated 3.0.0
166  * @deprecated Use register_setting()
167  * @see register_setting()
168  *
169  * @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
170  *      Default whitelisted option key names include "general," "discussion," and "reading," among others.
171  * @param string $option_name The name of an option to sanitize and save.
172  * @param callable $sanitize_callback A callback function that sanitizes the option's value.
173  */
174 function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
175         _deprecated_function( __FUNCTION__, '3.0', 'register_setting()' );
176         register_setting( $option_group, $option_name, $sanitize_callback );
177 }
178
179 /**
180  * Unregister a setting
181  *
182  * @since 2.7.0
183  * @deprecated 3.0.0
184  * @deprecated Use unregister_setting()
185  * @see unregister_setting()
186  *
187  * @param string $option_group
188  * @param string $option_name
189  * @param callable $sanitize_callback
190  */
191 function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
192         _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' );
193         unregister_setting( $option_group, $option_name, $sanitize_callback );
194 }
195
196 /**
197  * Determines the language to use for CodePress syntax highlighting.
198  *
199  * @since 2.8.0
200  * @deprecated 3.0.0
201  *
202  * @param string $filename
203 **/
204 function codepress_get_lang( $filename ) {
205         _deprecated_function( __FUNCTION__, '3.0' );
206 }
207
208 /**
209  * Adds JavaScript required to make CodePress work on the theme/plugin editors.
210  *
211  * @since 2.8.0
212  * @deprecated 3.0.0
213 **/
214 function codepress_footer_js() {
215         _deprecated_function( __FUNCTION__, '3.0' );
216 }
217
218 /**
219  * Determine whether to use CodePress.
220  *
221  * @since 2.8.0
222  * @deprecated 3.0.0
223 **/
224 function use_codepress() {
225         _deprecated_function( __FUNCTION__, '3.0' );
226 }
227
228 /**
229  * @deprecated 3.1.0
230  *
231  * @return array List of user IDs.
232  */
233 function get_author_user_ids() {
234         _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
235
236         global $wpdb;
237         if ( !is_multisite() )
238                 $level_key = $wpdb->get_blog_prefix() . 'user_level';
239         else
240                 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
241
242         return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
243 }
244
245 /**
246  * @deprecated 3.1.0
247  *
248  * @param int $user_id User ID.
249  * @return array|bool List of editable authors. False if no editable users.
250  */
251 function get_editable_authors( $user_id ) {
252         _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
253
254         global $wpdb;
255
256         $editable = get_editable_user_ids( $user_id );
257
258         if ( !$editable ) {
259                 return false;
260         } else {
261                 $editable = join(',', $editable);
262                 $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
263         }
264
265         return apply_filters('get_editable_authors', $authors);
266 }
267
268 /**
269  * @deprecated 3.1.0
270  *
271  * @param int $user_id User ID.
272  * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
273  * @return mixed
274  */
275 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
276         _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
277
278         global $wpdb;
279
280         if ( ! $user = get_userdata( $user_id ) )
281                 return array();
282         $post_type_obj = get_post_type_object($post_type);
283
284         if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
285                 if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
286                         return array($user->ID);
287                 else
288                         return array();
289         }
290
291         if ( !is_multisite() )
292                 $level_key = $wpdb->get_blog_prefix() . 'user_level';
293         else
294                 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
295
296         $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
297         if ( $exclude_zeros )
298                 $query .= " AND meta_value != '0'";
299
300         return $wpdb->get_col( $query );
301 }
302
303 /**
304  * @deprecated 3.1.0
305  */
306 function get_nonauthor_user_ids() {
307         _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
308
309         global $wpdb;
310
311         if ( !is_multisite() )
312                 $level_key = $wpdb->get_blog_prefix() . 'user_level';
313         else
314                 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
315
316         return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
317 }
318
319 if ( !class_exists('WP_User_Search') ) :
320 /**
321  * WordPress User Search class.
322  *
323  * @since 2.1.0
324  * @deprecated 3.1.0
325  */
326 class WP_User_Search {
327
328         /**
329          * {@internal Missing Description}}
330          *
331          * @since 2.1.0
332          * @access private
333          * @var mixed
334          */
335         var $results;
336
337         /**
338          * {@internal Missing Description}}
339          *
340          * @since 2.1.0
341          * @access private
342          * @var string
343          */
344         var $search_term;
345
346         /**
347          * Page number.
348          *
349          * @since 2.1.0
350          * @access private
351          * @var int
352          */
353         var $page;
354
355         /**
356          * Role name that users have.
357          *
358          * @since 2.5.0
359          * @access private
360          * @var string
361          */
362         var $role;
363
364         /**
365          * Raw page number.
366          *
367          * @since 2.1.0
368          * @access private
369          * @var int|bool
370          */
371         var $raw_page;
372
373         /**
374          * Amount of users to display per page.
375          *
376          * @since 2.1.0
377          * @access public
378          * @var int
379          */
380         var $users_per_page = 50;
381
382         /**
383          * {@internal Missing Description}}
384          *
385          * @since 2.1.0
386          * @access private
387          * @var int
388          */
389         var $first_user;
390
391         /**
392          * {@internal Missing Description}}
393          *
394          * @since 2.1.0
395          * @access private
396          * @var int
397          */
398         var $last_user;
399
400         /**
401          * {@internal Missing Description}}
402          *
403          * @since 2.1.0
404          * @access private
405          * @var string
406          */
407         var $query_limit;
408
409         /**
410          * {@internal Missing Description}}
411          *
412          * @since 3.0.0
413          * @access private
414          * @var string
415          */
416         var $query_orderby;
417
418         /**
419          * {@internal Missing Description}}
420          *
421          * @since 3.0.0
422          * @access private
423          * @var string
424          */
425         var $query_from;
426
427         /**
428          * {@internal Missing Description}}
429          *
430          * @since 3.0.0
431          * @access private
432          * @var string
433          */
434         var $query_where;
435
436         /**
437          * {@internal Missing Description}}
438          *
439          * @since 2.1.0
440          * @access private
441          * @var int
442          */
443         var $total_users_for_query = 0;
444
445         /**
446          * {@internal Missing Description}}
447          *
448          * @since 2.1.0
449          * @access private
450          * @var bool
451          */
452         var $too_many_total_users = false;
453
454         /**
455          * {@internal Missing Description}}
456          *
457          * @since 2.1.0
458          * @access private
459          * @var WP_Error
460          */
461         var $search_errors;
462
463         /**
464          * {@internal Missing Description}}
465          *
466          * @since 2.7.0
467          * @access private
468          * @var string
469          */
470         var $paging_text;
471
472         /**
473          * PHP4 Constructor - Sets up the object properties.
474          *
475          * @since 2.1.0
476          *
477          * @param string $search_term Search terms string.
478          * @param int $page Optional. Page ID.
479          * @param string $role Role name.
480          * @return WP_User_Search
481          */
482         function WP_User_Search ($search_term = '', $page = '', $role = '') {
483                 _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
484
485                 $this->search_term = wp_unslash( $search_term );
486                 $this->raw_page = ( '' == $page ) ? false : (int) $page;
487                 $this->page = (int) ( '' == $page ) ? 1 : $page;
488                 $this->role = $role;
489
490                 $this->prepare_query();
491                 $this->query();
492                 $this->do_paging();
493         }
494
495         /**
496          * {@internal Missing Short Description}}
497          *
498          * {@internal Missing Long Description}}
499          *
500          * @since 2.1.0
501          * @access public
502          */
503         function prepare_query() {
504                 global $wpdb;
505                 $this->first_user = ($this->page - 1) * $this->users_per_page;
506
507                 $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
508                 $this->query_orderby = ' ORDER BY user_login';
509
510                 $search_sql = '';
511                 if ( $this->search_term ) {
512                         $searches = array();
513                         $search_sql = 'AND (';
514                         foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
515                                 $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
516                         $search_sql .= implode(' OR ', $searches);
517                         $search_sql .= ')';
518                 }
519
520                 $this->query_from = " FROM $wpdb->users";
521                 $this->query_where = " WHERE 1=1 $search_sql";
522
523                 if ( $this->role ) {
524                         $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
525                         $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
526                 } elseif ( is_multisite() ) {
527                         $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
528                         $this->query_from .= ", $wpdb->usermeta";
529                         $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
530                 }
531
532                 do_action_ref_array( 'pre_user_search', array( &$this ) );
533         }
534
535         /**
536          * {@internal Missing Short Description}}
537          *
538          * {@internal Missing Long Description}}
539          *
540          * @since 2.1.0
541          * @access public
542          */
543         function query() {
544                 global $wpdb;
545
546                 $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
547
548                 if ( $this->results )
549                         $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
550                 else
551                         $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
552         }
553
554         /**
555          * {@internal Missing Short Description}}
556          *
557          * {@internal Missing Long Description}}
558          *
559          * @since 2.1.0
560          * @access public
561          */
562         function prepare_vars_for_template_usage() {}
563
564         /**
565          * {@internal Missing Short Description}}
566          *
567          * {@internal Missing Long Description}}
568          *
569          * @since 2.1.0
570          * @access public
571          */
572         function do_paging() {
573                 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
574                         $args = array();
575                         if( ! empty($this->search_term) )
576                                 $args['usersearch'] = urlencode($this->search_term);
577                         if( ! empty($this->role) )
578                                 $args['role'] = urlencode($this->role);
579
580                         $this->paging_text = paginate_links( array(
581                                 'total' => ceil($this->total_users_for_query / $this->users_per_page),
582                                 'current' => $this->page,
583                                 'base' => 'users.php?%_%',
584                                 'format' => 'userspage=%#%',
585                                 'add_args' => $args
586                         ) );
587                         if ( $this->paging_text ) {
588                                 $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
589                                         number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
590                                         number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
591                                         number_format_i18n( $this->total_users_for_query ),
592                                         $this->paging_text
593                                 );
594                         }
595                 }
596         }
597
598         /**
599          * {@internal Missing Short Description}}
600          *
601          * {@internal Missing Long Description}}
602          *
603          * @since 2.1.0
604          * @access public
605          *
606          * @return array
607          */
608         function get_results() {
609                 return (array) $this->results;
610         }
611
612         /**
613          * Displaying paging text.
614          *
615          * @see do_paging() Builds paging text.
616          *
617          * @since 2.1.0
618          * @access public
619          */
620         function page_links() {
621                 echo $this->paging_text;
622         }
623
624         /**
625          * Whether paging is enabled.
626          *
627          * @see do_paging() Builds paging text.
628          *
629          * @since 2.1.0
630          * @access public
631          *
632          * @return bool
633          */
634         function results_are_paged() {
635                 if ( $this->paging_text )
636                         return true;
637                 return false;
638         }
639
640         /**
641          * Whether there are search terms.
642          *
643          * @since 2.1.0
644          * @access public
645          *
646          * @return bool
647          */
648         function is_search() {
649                 if ( $this->search_term )
650                         return true;
651                 return false;
652         }
653 }
654 endif;
655
656 /**
657  * Retrieve editable posts from other users.
658  *
659  * @deprecated 3.1.0
660  *
661  * @param int $user_id User ID to not retrieve posts from.
662  * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
663  * @return array List of posts from others.
664  */
665 function get_others_unpublished_posts($user_id, $type='any') {
666         _deprecated_function( __FUNCTION__, '3.1' );
667
668         global $wpdb;
669
670         $editable = get_editable_user_ids( $user_id );
671
672         if ( in_array($type, array('draft', 'pending')) )
673                 $type_sql = " post_status = '$type' ";
674         else
675                 $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
676
677         $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
678
679         if ( !$editable ) {
680                 $other_unpubs = '';
681         } else {
682                 $editable = join(',', $editable);
683                 $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
684         }
685
686         return apply_filters('get_others_drafts', $other_unpubs);
687 }
688
689 /**
690  * Retrieve drafts from other users.
691  *
692  * @deprecated 3.1.0
693  *
694  * @param int $user_id User ID.
695  * @return array List of drafts from other users.
696  */
697 function get_others_drafts($user_id) {
698         _deprecated_function( __FUNCTION__, '3.1' );
699
700         return get_others_unpublished_posts($user_id, 'draft');
701 }
702
703 /**
704  * Retrieve pending review posts from other users.
705  *
706  * @deprecated 3.1.0
707  *
708  * @param int $user_id User ID.
709  * @return array List of posts with pending review post type from other users.
710  */
711 function get_others_pending($user_id) {
712         _deprecated_function( __FUNCTION__, '3.1' );
713
714         return get_others_unpublished_posts($user_id, 'pending');
715 }
716
717 /**
718  * Output the QuickPress dashboard widget.
719  *
720  * @since 3.0.0
721  * @deprecated 3.2.0
722  * @deprecated Use wp_dashboard_quick_press()
723  * @see wp_dashboard_quick_press()
724  */
725 function wp_dashboard_quick_press_output() {
726         _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
727         wp_dashboard_quick_press();
728 }
729
730 /**
731  * @since 2.7.0
732  * @deprecated 3.3.0
733  * @deprecated Use wp_editor()
734  * @see wp_editor()
735  */
736 function wp_tiny_mce( $teeny = false, $settings = false ) {
737         _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
738
739         static $num = 1;
740
741         if ( ! class_exists('_WP_Editors' ) )
742                 require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
743
744         $editor_id = 'content' . $num++;
745
746         $set = array(
747                 'teeny' => $teeny,
748                 'tinymce' => $settings ? $settings : true,
749                 'quicktags' => false
750         );
751
752         $set = _WP_Editors::parse_settings($editor_id, $set);
753         _WP_Editors::editor_settings($editor_id, $set);
754 }
755
756 /**
757  * @deprecated 3.3.0
758  * @deprecated Use wp_editor()
759  * @see wp_editor()
760  */
761 function wp_preload_dialogs() {
762         _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
763 }
764
765 /**
766  * @deprecated 3.3.0
767  * @deprecated Use wp_editor()
768  * @see wp_editor()
769  */
770 function wp_print_editor_js() {
771         _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
772 }
773
774 /**
775  * @deprecated 3.3.0
776  * @deprecated Use wp_editor()
777  * @see wp_editor()
778  */
779 function wp_quicktags() {
780         _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
781 }
782
783 /**
784  * Returns the screen layout options.
785  *
786  * @since 2.8.0
787  * @deprecated 3.3.0
788  * @deprecated Use $current_screen->render_screen_layout()
789  * @see WP_Screen::render_screen_layout()
790  */
791 function screen_layout( $screen ) {
792         _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_layout()' );
793
794         $current_screen = get_current_screen();
795
796         if ( ! $current_screen )
797                 return '';
798
799         ob_start();
800         $current_screen->render_screen_layout();
801         return ob_get_clean();
802 }
803
804 /**
805  * Returns the screen's per-page options.
806  *
807  * @since 2.8.0
808  * @deprecated 3.3.0
809  * @deprecated Use $current_screen->render_per_page_options()
810  * @see WP_Screen::render_per_page_options()
811  */
812 function screen_options( $screen ) {
813         _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_per_page_options()' );
814
815         $current_screen = get_current_screen();
816
817         if ( ! $current_screen )
818                 return '';
819
820         ob_start();
821         $current_screen->render_per_page_options();
822         return ob_get_clean();
823 }
824
825 /**
826  * Renders the screen's help.
827  *
828  * @since 2.7.0
829  * @deprecated 3.3.0
830  * @deprecated Use $current_screen->render_screen_meta()
831  * @see WP_Screen::render_screen_meta()
832  */
833 function screen_meta( $screen ) {
834         $current_screen = get_current_screen();
835         $current_screen->render_screen_meta();
836 }
837
838 /**
839  * Favorite actions were deprecated in version 3.2. Use the admin bar instead.
840  *
841  * @since 2.7.0
842  * @deprecated 3.2.0
843  */
844 function favorite_actions() {
845         _deprecated_function( __FUNCTION__, '3.2', 'WP_Admin_Bar' );
846 }
847
848 function media_upload_image() {
849         _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
850         return wp_media_upload_handler();
851 }
852
853 function media_upload_audio() {
854         _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
855         return wp_media_upload_handler();
856 }
857
858 function media_upload_video() {
859         _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
860         return wp_media_upload_handler();
861 }
862
863 function media_upload_file() {
864         _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
865         return wp_media_upload_handler();
866 }
867
868 function type_url_form_image() {
869         _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('image')" );
870         return wp_media_insert_url_form( 'image' );
871 }
872
873 function type_url_form_audio() {
874         _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('audio')" );
875         return wp_media_insert_url_form( 'audio' );
876 }
877
878 function type_url_form_video() {
879         _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('video')" );
880         return wp_media_insert_url_form( 'video' );
881 }
882
883 function type_url_form_file() {
884         _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('file')" );
885         return wp_media_insert_url_form( 'file' );
886 }
887
888 /**
889  * Add contextual help text for a page.
890  *
891  * Creates an 'Overview' help tab.
892  *
893  * @since 2.7.0
894  * @deprecated 3.3.0
895  * @deprecated Use get_current_screen()->add_help_tab()
896  * @see WP_Screen
897  *
898  * @param string    $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
899  * @param string    $help   The content of an 'Overview' help tab.
900  */
901 function add_contextual_help( $screen, $help ) {
902         _deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' );
903
904         if ( is_string( $screen ) )
905                 $screen = convert_to_screen( $screen );
906
907         WP_Screen::add_old_compat_help( $screen, $help );
908 }
909
910 /**
911  * Get the allowed themes for the current blog.
912  *
913  * @since 3.0.0
914  * @deprecated 3.4.0
915  * @deprecated Use wp_get_themes()
916  * @see wp_get_themes()
917  *
918  * @return array $themes Array of allowed themes.
919  */
920 function get_allowed_themes() {
921         _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'allowed' => true ) )" );
922
923         $themes = wp_get_themes( array( 'allowed' => true ) );
924
925         $wp_themes = array();
926         foreach ( $themes as $theme ) {
927                 $wp_themes[ $theme->get('Name') ] = $theme;
928         }
929
930         return $wp_themes;
931 }
932
933 /**
934  * {@internal Missing Short Description}}
935  *
936  * @since 1.5.0
937  * @deprecated 3.4.0
938  *
939  * @return array
940  */
941 function get_broken_themes() {
942         _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'errors' => true )" );
943
944         $themes = wp_get_themes( array( 'errors' => true ) );
945         $broken = array();
946         foreach ( $themes as $theme ) {
947                 $name = $theme->get('Name');
948                 $broken[ $name ] = array(
949                         'Name' => $name,
950                         'Title' => $name,
951                         'Description' => $theme->errors()->get_error_message(),
952                 );
953         }
954         return $broken;
955 }
956
957 /**
958  * {@internal Missing Short Description}}
959  *
960  * @since 2.0.0
961  * @deprecated 3.4.0
962  *
963  * @return WP_Theme
964  */
965 function current_theme_info() {
966         _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
967
968         return wp_get_theme();
969 }
970
971 /**
972  * This was once used to display an 'Insert into Post' button. Now it is deprecated and stubbed.
973  *
974  * @deprecated 3.5.0
975  */
976 function _insert_into_post_button( $type ) {
977         _deprecated_function( __FUNCTION__, '3.5' );
978 }
979
980 /**
981  * This was once used to display a media button. Now it is deprecated and stubbed.
982  *
983  * @deprecated 3.5.0
984  */
985 function _media_button($title, $icon, $type, $id) {
986         _deprecated_function( __FUNCTION__, '3.5' );
987 }
988
989 /**
990  * Get an existing post and format it for editing.
991  *
992  * @since 2.0.0
993  * @deprecated 3.5.0
994  *
995  * @param int $id
996  * @return object
997  */
998 function get_post_to_edit( $id ) {
999         _deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
1000
1001         return get_post( $id, OBJECT, 'edit' );
1002 }
1003
1004 /**
1005  * Get the default page information to use.
1006  *
1007  * @since 2.5.0
1008  * @deprecated 3.5.0
1009  * @deprecated Use get_default_post_to_edit()
1010  *
1011  * @return WP_Post Post object containing all the default post data as attributes
1012  */
1013 function get_default_page_to_edit() {
1014         _deprecated_function( __FUNCTION__, '3.5', "get_default_post_to_edit( 'page' )" );
1015
1016         $page = get_default_post_to_edit();
1017         $page->post_type = 'page';
1018         return $page;
1019 }
1020
1021 /**
1022  * This was once used to create a thumbnail from an Image given a maximum side size.
1023  *
1024  * @since 1.2.0
1025  * @deprecated 3.5.0
1026  * @deprecated Use image_resize()
1027  * @see image_resize()
1028  *
1029  * @param mixed $file Filename of the original image, Or attachment id.
1030  * @param int $max_side Maximum length of a single side for the thumbnail.
1031  * @param mixed $deprecated Never used.
1032  * @return string Thumbnail path on success, Error string on failure.
1033  */
1034 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
1035         _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' );
1036         return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
1037 }
1038
1039 /**
1040  * This was once used to display a metabox for the nav menu theme locations.
1041  *
1042  * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
1043  *
1044  * @since 3.0.0
1045  * @deprecated 3.6.0
1046  */
1047 function wp_nav_menu_locations_meta_box() {
1048         _deprecated_function( __FUNCTION__, '3.6' );
1049 }
1050
1051 /**
1052  * This was once used to kick-off the Core Updater.
1053  *
1054  * Deprecated in favor of instantating a Core_Upgrader instance directly,
1055  * and calling the 'upgrade' method.
1056  *
1057  * @since 2.7.0
1058  * @deprecated 3.7.0
1059  * @see Core_Upgrader
1060  */
1061 function wp_update_core($current, $feedback = '') {
1062         _deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' );
1063
1064         if ( !empty($feedback) )
1065                 add_filter('update_feedback', $feedback);
1066
1067         include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1068         $upgrader = new Core_Upgrader();
1069         return $upgrader->upgrade($current);
1070
1071 }
1072
1073 /**
1074  * This was once used to kick-off the Plugin Updater.
1075  *
1076  * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
1077  * and calling the 'upgrade' method.
1078  * Unused since 2.8.0.
1079  *
1080  * @since 2.5.0
1081  * @deprecated 3.7.0
1082  * @see Plugin_Upgrader
1083  */
1084 function wp_update_plugin($plugin, $feedback = '') {
1085         _deprecated_function( __FUNCTION__, '3.7', 'new Plugin_Upgrader();' );
1086
1087         if ( !empty($feedback) )
1088                 add_filter('update_feedback', $feedback);
1089
1090         include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1091         $upgrader = new Plugin_Upgrader();
1092         return $upgrader->upgrade($plugin);
1093 }
1094
1095 /**
1096  * This was once used to kick-off the Theme Updater.
1097  *
1098  * Deprecated in favor of instantating a Theme_Upgrader instance directly,
1099  * and calling the 'upgrade' method.
1100  * Unused since 2.8.0.
1101  *
1102  * @since 2.7.0
1103  * @deprecated 3.7.0
1104  * @see Theme_Upgrader
1105  */
1106 function wp_update_theme($theme, $feedback = '') {
1107         _deprecated_function( __FUNCTION__, '3.7', 'new Theme_Upgrader();' );
1108
1109         if ( !empty($feedback) )
1110                 add_filter('update_feedback', $feedback);
1111
1112         include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1113         $upgrader = new Theme_Upgrader();
1114         return $upgrader->upgrade($theme);
1115 }
1116
1117 /**
1118  * This was once used to display attachment links. Now it is deprecated and stubbed.
1119  *
1120  * {@internal Missing Short Description}}
1121  *
1122  * @since 2.0.0
1123  * @deprecated 3.7.0
1124  *
1125  * @param int|bool $id
1126  */
1127 function the_attachment_links( $id = false ) {
1128         _deprecated_function( __FUNCTION__, '3.7' );
1129 }
1130
1131 /**#@+
1132  * Displays a screen icon.
1133  *
1134  * @since 2.7.0
1135  * @since 3.8.0 Screen icons are no longer used in WordPress. This function no longer produces output.
1136  * @deprecated 3.8.0
1137  */
1138 function screen_icon() {
1139         echo get_screen_icon();
1140 }
1141 function get_screen_icon() {
1142         return '<!-- Screen icons are no longer used as of WordPress 3.8. -->';
1143 }
1144 /**#@-*/
1145
1146 /**#@+
1147  * Deprecated dashboard widget controls.
1148  *
1149  * @since 2.5.0
1150  * @deprecated 3.8.0
1151  */
1152 function wp_dashboard_incoming_links_output() {}
1153 function wp_dashboard_secondary_output() {}
1154 /**#@-*/
1155
1156 /**#@+
1157  * Deprecated dashboard widget controls.
1158  *
1159  * @since 2.7.0
1160  * @deprecated 3.8.0
1161  */
1162 function wp_dashboard_incoming_links() {}
1163 function wp_dashboard_incoming_links_control() {}
1164 function wp_dashboard_plugins() {}
1165 function wp_dashboard_primary_control() {}
1166 function wp_dashboard_recent_comments_control() {}
1167 function wp_dashboard_secondary() {}
1168 function wp_dashboard_secondary_control() {}
1169 /**#@-*/
1170
1171 /**
1172  * This was once used to move child posts to a new parent.
1173  *
1174  * @since 2.3.0
1175  * @deprecated 3.9.0
1176  * @access private
1177  *
1178  * @param int $old_ID
1179  * @param int $new_ID
1180  */
1181 function _relocate_children( $old_ID, $new_ID ) {
1182         _deprecated_function( __FUNCTION__, '3.9' );
1183 }