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
8 * @subpackage Deprecated
12 * Deprecated functions come here to die.
17 * @deprecated 2.1.0 Use wp_editor()
20 function tinymce_include() {
21 _deprecated_function( __FUNCTION__, '2.1', 'wp_editor()' );
27 * Unused Admin function.
33 function documentation_link() {
34 _deprecated_function( __FUNCTION__, '2.5' );
38 * Calculates the new dimensions for a downsampled image.
41 * @deprecated 3.0.0 Use wp_constrain_dimensions()
42 * @see wp_constrain_dimensions()
44 * @param int $width Current width of the image
45 * @param int $height Current height of the image
46 * @param int $wmax Maximum wanted width
47 * @param int $hmax Maximum wanted height
48 * @return array Shrunk dimensions (width, height).
50 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
51 _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );
52 return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
56 * Calculated the new dimensions for a downsampled image.
59 * @deprecated 3.5.0 Use wp_constrain_dimensions()
60 * @see wp_constrain_dimensions()
62 * @param int $width Current width of the image
63 * @param int $height Current height of the image
64 * @return array Shrunk dimensions (width, height).
66 function get_udims( $width, $height ) {
67 _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' );
68 return wp_constrain_dimensions( $width, $height, 128, 96 );
72 * Legacy function used to generate the categories checklist control.
75 * @deprecated 2.6.0 Use wp_category_checklist()
76 * @see wp_category_checklist()
78 * @param int $default Unused.
79 * @param int $parent Unused.
80 * @param array $popular_ids Unused.
82 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
83 _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' );
85 wp_category_checklist( $post_ID );
89 * Legacy function used to generate a link categories checklist control.
92 * @deprecated 2.6.0 Use wp_link_category_checklist()
93 * @see wp_link_category_checklist()
95 * @param int $default Unused.
97 function dropdown_link_categories( $default = 0 ) {
98 _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' );
100 wp_link_category_checklist( $link_id );
104 * Get the real filesystem path to a file to edit within the admin.
108 * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
110 * @param string $file Filesystem path relative to the wp-content directory.
111 * @return string Full filesystem path to edit.
113 function get_real_file_to_edit( $file ) {
114 _deprecated_function( __FUNCTION__, '2.9' );
116 return WP_CONTENT_DIR . $file;
120 * Legacy function used for generating a categories drop-down control.
123 * @deprecated 3.0.0 Use wp_dropdown_categories()
124 * @see wp_dropdown_categories()
126 * @param int $currentcat Optional. ID of the current category. Default 0.
127 * @param int $currentparent Optional. Current parent category ID. Default 0.
128 * @param int $parent Optional. Parent ID to retrieve categories for. Default 0.
129 * @param int $level Optional. Number of levels deep to display. Default 0.
130 * @param array $categories Optional. Categories to include in the control. Default 0.
131 * @return bool|null False if no categories were found.
133 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
134 _deprecated_function( __FUNCTION__, '3.0', 'wp_dropdown_categories()' );
136 $categories = get_categories( array('hide_empty' => 0) );
139 foreach ( $categories as $category ) {
140 if ( $currentcat != $category->term_id && $parent == $category->parent) {
141 $pad = str_repeat( '– ', $level );
142 $category->name = esc_html( $category->name );
143 echo "\n\t<option value='$category->term_id'";
144 if ( $currentparent == $category->term_id )
145 echo " selected='selected'";
146 echo ">$pad$category->name</option>";
147 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
156 * Register a setting and its sanitization callback
159 * @deprecated 3.0.0 Use register_setting()
160 * @see register_setting()
162 * @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
163 * Default whitelisted option key names include "general," "discussion," and "reading," among others.
164 * @param string $option_name The name of an option to sanitize and save.
165 * @param callable $sanitize_callback A callback function that sanitizes the option's value.
167 function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
168 _deprecated_function( __FUNCTION__, '3.0', 'register_setting()' );
169 register_setting( $option_group, $option_name, $sanitize_callback );
173 * Unregister a setting
176 * @deprecated 3.0.0 Use unregister_setting()
177 * @see unregister_setting()
179 * @param string $option_group
180 * @param string $option_name
181 * @param callable $sanitize_callback
183 function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
184 _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' );
185 unregister_setting( $option_group, $option_name, $sanitize_callback );
189 * Determines the language to use for CodePress syntax highlighting.
194 * @param string $filename
196 function codepress_get_lang( $filename ) {
197 _deprecated_function( __FUNCTION__, '3.0' );
201 * Adds JavaScript required to make CodePress work on the theme/plugin editors.
206 function codepress_footer_js() {
207 _deprecated_function( __FUNCTION__, '3.0' );
211 * Determine whether to use CodePress.
216 function use_codepress() {
217 _deprecated_function( __FUNCTION__, '3.0' );
223 * @deprecated 3.1.0 Use get_users()
225 * @return array List of user IDs.
227 function get_author_user_ids() {
228 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
231 if ( !is_multisite() )
232 $level_key = $wpdb->get_blog_prefix() . 'user_level';
234 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
236 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
240 * Gets author users who can edit posts.
242 * @deprecated 3.1.0 Use get_users()
244 * @param int $user_id User ID.
245 * @return array|bool List of editable authors. False if no editable users.
247 function get_editable_authors( $user_id ) {
248 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
252 $editable = get_editable_user_ids( $user_id );
257 $editable = join(',', $editable);
258 $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
261 return apply_filters('get_editable_authors', $authors);
265 * Gets the IDs of any users who can edit posts.
267 * @deprecated 3.1.0 Use get_users()
269 * @param int $user_id User ID.
270 * @param bool $exclude_zeros Optional. Whether to exclude zeroes. Default true.
271 * @return array Array of editable user IDs, empty array otherwise.
273 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
274 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
278 if ( ! $user = get_userdata( $user_id ) )
280 $post_type_obj = get_post_type_object($post_type);
282 if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
283 if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
284 return array($user->ID);
289 if ( !is_multisite() )
290 $level_key = $wpdb->get_blog_prefix() . 'user_level';
292 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
294 $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
295 if ( $exclude_zeros )
296 $query .= " AND meta_value != '0'";
298 return $wpdb->get_col( $query );
302 * Gets all users who are not authors.
304 * @deprecated 3.1.0 Use get_users()
306 function get_nonauthor_user_ids() {
307 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
311 if ( !is_multisite() )
312 $level_key = $wpdb->get_blog_prefix() . 'user_level';
314 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
316 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
319 if ( ! class_exists( 'WP_User_Search', false ) ) :
321 * WordPress User Search class.
324 * @deprecated 3.1.0 Use WP_User_Query
326 class WP_User_Search {
329 * {@internal Missing Description}}
338 * {@internal Missing Description}}
356 * Role name that users have.
374 * Amount of users to display per page.
380 var $users_per_page = 50;
383 * {@internal Missing Description}}
392 * {@internal Missing Description}}
401 * {@internal Missing Description}}
410 * {@internal Missing Description}}
419 * {@internal Missing Description}}
428 * {@internal Missing Description}}
437 * {@internal Missing Description}}
443 var $total_users_for_query = 0;
446 * {@internal Missing Description}}
452 var $too_many_total_users = false;
455 * {@internal Missing Description}}
464 * {@internal Missing Description}}
473 * PHP5 Constructor - Sets up the object properties.
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
482 function __construct( $search_term = '', $page = '', $role = '' ) {
483 _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
485 $this->search_term = wp_unslash( $search_term );
486 $this->raw_page = ( '' == $page ) ? false : (int) $page;
487 $this->page = (int) ( '' == $page ) ? 1 : $page;
490 $this->prepare_query();
496 * PHP4 Constructor - Sets up the object properties.
500 * @param string $search_term Search terms string.
501 * @param int $page Optional. Page ID.
502 * @param string $role Role name.
503 * @return WP_User_Search
505 public function WP_User_Search( $search_term = '', $page = '', $role = '' ) {
506 self::__construct( $search_term, $page, $role );
510 * Prepares the user search query (legacy).
515 public function prepare_query() {
517 $this->first_user = ($this->page - 1) * $this->users_per_page;
519 $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
520 $this->query_orderby = ' ORDER BY user_login';
523 if ( $this->search_term ) {
525 $search_sql = 'AND (';
526 foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
527 $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
528 $search_sql .= implode(' OR ', $searches);
532 $this->query_from = " FROM $wpdb->users";
533 $this->query_where = " WHERE 1=1 $search_sql";
536 $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
537 $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
538 } elseif ( is_multisite() ) {
539 $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
540 $this->query_from .= ", $wpdb->usermeta";
541 $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
544 do_action_ref_array( 'pre_user_search', array( &$this ) );
548 * Executes the user search query.
553 public function query() {
556 $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
558 if ( $this->results )
559 $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
561 $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
565 * Prepares variables for use in templates.
570 function prepare_vars_for_template_usage() {}
573 * Handles paging for the user search query.
578 public function do_paging() {
579 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
581 if ( ! empty($this->search_term) )
582 $args['usersearch'] = urlencode($this->search_term);
583 if ( ! empty($this->role) )
584 $args['role'] = urlencode($this->role);
586 $this->paging_text = paginate_links( array(
587 'total' => ceil($this->total_users_for_query / $this->users_per_page),
588 'current' => $this->page,
589 'base' => 'users.php?%_%',
590 'format' => 'userspage=%#%',
593 if ( $this->paging_text ) {
594 $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
595 number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
596 number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
597 number_format_i18n( $this->total_users_for_query ),
605 * Retrieves the user search query results.
612 public function get_results() {
613 return (array) $this->results;
617 * Displaying paging text.
619 * @see do_paging() Builds paging text.
624 function page_links() {
625 echo $this->paging_text;
629 * Whether paging is enabled.
631 * @see do_paging() Builds paging text.
638 function results_are_paged() {
639 if ( $this->paging_text )
645 * Whether there are search terms.
652 function is_search() {
653 if ( $this->search_term )
661 * Retrieves editable posts from other users.
664 * @deprecated 3.1.0 Use get_posts()
667 * @param int $user_id User ID to not retrieve posts from.
668 * @param string $type Optional. Post type to retrieve. Accepts 'draft', 'pending' or 'any' (all).
670 * @return array List of posts from others.
672 function get_others_unpublished_posts( $user_id, $type = 'any' ) {
673 _deprecated_function( __FUNCTION__, '3.1' );
677 $editable = get_editable_user_ids( $user_id );
679 if ( in_array($type, array('draft', 'pending')) )
680 $type_sql = " post_status = '$type' ";
682 $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
684 $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
689 $editable = join(',', $editable);
690 $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) );
693 return apply_filters('get_others_drafts', $other_unpubs);
697 * Retrieve drafts from other users.
699 * @deprecated 3.1.0 Use get_posts()
702 * @param int $user_id User ID.
703 * @return array List of drafts from other users.
705 function get_others_drafts($user_id) {
706 _deprecated_function( __FUNCTION__, '3.1' );
708 return get_others_unpublished_posts($user_id, 'draft');
712 * Retrieve pending review posts from other users.
714 * @deprecated 3.1.0 Use get_posts()
717 * @param int $user_id User ID.
718 * @return array List of posts with pending review post type from other users.
720 function get_others_pending($user_id) {
721 _deprecated_function( __FUNCTION__, '3.1' );
723 return get_others_unpublished_posts($user_id, 'pending');
727 * Output the QuickPress dashboard widget.
730 * @deprecated 3.2.0 Use wp_dashboard_quick_press()
731 * @see wp_dashboard_quick_press()
733 function wp_dashboard_quick_press_output() {
734 _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
735 wp_dashboard_quick_press();
739 * Outputs the TinyMCE editor.
742 * @deprecated 3.3.0 Use wp_editor()
745 * @staticvar int $num
747 function wp_tiny_mce( $teeny = false, $settings = false ) {
748 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
752 if ( ! class_exists( '_WP_Editors', false ) )
753 require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
755 $editor_id = 'content' . $num++;
759 'tinymce' => $settings ? $settings : true,
763 $set = _WP_Editors::parse_settings($editor_id, $set);
764 _WP_Editors::editor_settings($editor_id, $set);
768 * Preloads TinyMCE dialogs.
770 * @deprecated 3.3.0 Use wp_editor()
773 function wp_preload_dialogs() {
774 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
778 * Prints TinyMCE editor JS.
780 * @deprecated 3.3.0 Use wp_editor()
783 function wp_print_editor_js() {
784 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
790 * @deprecated 3.3.0 Use wp_editor()
793 function wp_quicktags() {
794 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
798 * Returns the screen layout options.
801 * @deprecated 3.3.0 WP_Screen::render_screen_layout()
802 * @see WP_Screen::render_screen_layout()
804 function screen_layout( $screen ) {
805 _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_layout()' );
807 $current_screen = get_current_screen();
809 if ( ! $current_screen )
813 $current_screen->render_screen_layout();
814 return ob_get_clean();
818 * Returns the screen's per-page options.
821 * @deprecated 3.3.0 Use WP_Screen::render_per_page_options()
822 * @see WP_Screen::render_per_page_options()
824 function screen_options( $screen ) {
825 _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_per_page_options()' );
827 $current_screen = get_current_screen();
829 if ( ! $current_screen )
833 $current_screen->render_per_page_options();
834 return ob_get_clean();
838 * Renders the screen's help.
841 * @deprecated 3.3.0 Use WP_Screen::render_screen_meta()
842 * @see WP_Screen::render_screen_meta()
844 function screen_meta( $screen ) {
845 $current_screen = get_current_screen();
846 $current_screen->render_screen_meta();
850 * Favorite actions were deprecated in version 3.2. Use the admin bar instead.
853 * @deprecated 3.2.0 Use WP_Admin_Bar
856 function favorite_actions() {
857 _deprecated_function( __FUNCTION__, '3.2', 'WP_Admin_Bar' );
861 * Handles uploading an image.
863 * @deprecated 3.3.0 Use wp_media_upload_handler()
864 * @see wp_media_upload_handler()
866 * @return null|string
868 function media_upload_image() {
869 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
870 return wp_media_upload_handler();
874 * Handles uploading an audio file.
876 * @deprecated 3.3.0 Use wp_media_upload_handler()
877 * @see wp_media_upload_handler()
879 * @return null|string
881 function media_upload_audio() {
882 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
883 return wp_media_upload_handler();
887 * Handles uploading a video file.
889 * @deprecated 3.3.0 Use wp_media_upload_handler()
890 * @see wp_media_upload_handler()
892 * @return null|string
894 function media_upload_video() {
895 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
896 return wp_media_upload_handler();
900 * Handles uploading a generic file.
902 * @deprecated 3.3.0 Use wp_media_upload_handler()
903 * @see wp_media_upload_handler()
905 * @return null|string
907 function media_upload_file() {
908 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
909 return wp_media_upload_handler();
913 * Handles retrieving the insert-from-URL form for an image.
915 * @deprecated 3.3.0 Use wp_media_insert_url_form()
916 * @see wp_media_insert_url_form()
920 function type_url_form_image() {
921 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('image')" );
922 return wp_media_insert_url_form( 'image' );
926 * Handles retrieving the insert-from-URL form for an audio file.
928 * @deprecated 3.3.0 Use wp_media_insert_url_form()
929 * @see wp_media_insert_url_form()
933 function type_url_form_audio() {
934 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('audio')" );
935 return wp_media_insert_url_form( 'audio' );
939 * Handles retrieving the insert-from-URL form for a video file.
941 * @deprecated 3.3.0 Use wp_media_insert_url_form()
942 * @see wp_media_insert_url_form()
946 function type_url_form_video() {
947 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('video')" );
948 return wp_media_insert_url_form( 'video' );
952 * Handles retrieving the insert-from-URL form for a generic file.
954 * @deprecated 3.3.0 Use wp_media_insert_url_form()
955 * @see wp_media_insert_url_form()
959 function type_url_form_file() {
960 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('file')" );
961 return wp_media_insert_url_form( 'file' );
965 * Add contextual help text for a page.
967 * Creates an 'Overview' help tab.
970 * @deprecated 3.3.0 Use WP_Screen::add_help_tab()
971 * @see WP_Screen::add_help_tab()
973 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
974 * @param string $help The content of an 'Overview' help tab.
976 function add_contextual_help( $screen, $help ) {
977 _deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' );
979 if ( is_string( $screen ) )
980 $screen = convert_to_screen( $screen );
982 WP_Screen::add_old_compat_help( $screen, $help );
986 * Get the allowed themes for the current site.
989 * @deprecated 3.4.0 Use wp_get_themes()
990 * @see wp_get_themes()
992 * @return array $themes Array of allowed themes.
994 function get_allowed_themes() {
995 _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'allowed' => true ) )" );
997 $themes = wp_get_themes( array( 'allowed' => true ) );
999 $wp_themes = array();
1000 foreach ( $themes as $theme ) {
1001 $wp_themes[ $theme->get('Name') ] = $theme;
1008 * Retrieves a list of broken themes.
1011 * @deprecated 3.4.0 Use wp_get_themes()
1012 * @see wp_get_themes()
1016 function get_broken_themes() {
1017 _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'errors' => true )" );
1019 $themes = wp_get_themes( array( 'errors' => true ) );
1021 foreach ( $themes as $theme ) {
1022 $name = $theme->get('Name');
1023 $broken[ $name ] = array(
1026 'Description' => $theme->errors()->get_error_message(),
1033 * Retrieves information on the current active theme.
1036 * @deprecated 3.4.0 Use wp_get_theme()
1037 * @see wp_get_theme()
1041 function current_theme_info() {
1042 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
1044 return wp_get_theme();
1048 * This was once used to display an 'Insert into Post' button.
1050 * Now it is deprecated and stubbed.
1054 function _insert_into_post_button( $type ) {
1055 _deprecated_function( __FUNCTION__, '3.5' );
1059 * This was once used to display a media button.
1061 * Now it is deprecated and stubbed.
1065 function _media_button($title, $icon, $type, $id) {
1066 _deprecated_function( __FUNCTION__, '3.5' );
1070 * Gets an existing post and format it for editing.
1073 * @deprecated 3.5.0 Use get_post()
1079 function get_post_to_edit( $id ) {
1080 _deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
1082 return get_post( $id, OBJECT, 'edit' );
1086 * Gets the default page information to use.
1089 * @deprecated 3.5.0 Use get_default_post_to_edit()
1090 * @see get_default_post_to_edit()
1092 * @return WP_Post Post object containing all the default post data as attributes
1094 function get_default_page_to_edit() {
1095 _deprecated_function( __FUNCTION__, '3.5', "get_default_post_to_edit( 'page' )" );
1097 $page = get_default_post_to_edit();
1098 $page->post_type = 'page';
1103 * This was once used to create a thumbnail from an Image given a maximum side size.
1106 * @deprecated 3.5.0 Use image_resize()
1107 * @see image_resize()
1109 * @param mixed $file Filename of the original image, Or attachment id.
1110 * @param int $max_side Maximum length of a single side for the thumbnail.
1111 * @param mixed $deprecated Never used.
1112 * @return string Thumbnail path on success, Error string on failure.
1114 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
1115 _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' );
1116 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
1120 * This was once used to display a metabox for the nav menu theme locations.
1122 * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
1127 function wp_nav_menu_locations_meta_box() {
1128 _deprecated_function( __FUNCTION__, '3.6' );
1132 * This was once used to kick-off the Core Updater.
1134 * Deprecated in favor of instantating a Core_Upgrader instance directly,
1135 * and calling the 'upgrade' method.
1138 * @deprecated 3.7.0 Use Core_Upgrader
1139 * @see Core_Upgrader
1141 function wp_update_core($current, $feedback = '') {
1142 _deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' );
1144 if ( !empty($feedback) )
1145 add_filter('update_feedback', $feedback);
1147 include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1148 $upgrader = new Core_Upgrader();
1149 return $upgrader->upgrade($current);
1154 * This was once used to kick-off the Plugin Updater.
1156 * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
1157 * and calling the 'upgrade' method.
1158 * Unused since 2.8.0.
1161 * @deprecated 3.7.0 Use Plugin_Upgrader
1162 * @see Plugin_Upgrader
1164 function wp_update_plugin($plugin, $feedback = '') {
1165 _deprecated_function( __FUNCTION__, '3.7', 'new Plugin_Upgrader();' );
1167 if ( !empty($feedback) )
1168 add_filter('update_feedback', $feedback);
1170 include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1171 $upgrader = new Plugin_Upgrader();
1172 return $upgrader->upgrade($plugin);
1176 * This was once used to kick-off the Theme Updater.
1178 * Deprecated in favor of instantating a Theme_Upgrader instance directly,
1179 * and calling the 'upgrade' method.
1180 * Unused since 2.8.0.
1183 * @deprecated 3.7.0 Use Theme_Upgrader
1184 * @see Theme_Upgrader
1186 function wp_update_theme($theme, $feedback = '') {
1187 _deprecated_function( __FUNCTION__, '3.7', 'new Theme_Upgrader();' );
1189 if ( !empty($feedback) )
1190 add_filter('update_feedback', $feedback);
1192 include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1193 $upgrader = new Theme_Upgrader();
1194 return $upgrader->upgrade($theme);
1198 * This was once used to display attachment links. Now it is deprecated and stubbed.
1203 * @param int|bool $id
1205 function the_attachment_links( $id = false ) {
1206 _deprecated_function( __FUNCTION__, '3.7' );
1210 * Displays a screen icon.
1213 * @since 3.8.0 Screen icons are no longer used in WordPress. This function no longer produces output.
1214 * @deprecated 3.8.0 Use get_screen_icon()
1215 * @see get_screen_icon()
1217 function screen_icon() {
1218 echo get_screen_icon();
1222 * Retrieves the screen icon (no longer used in 3.8+).
1228 function get_screen_icon() {
1229 return '<!-- Screen icons are no longer used as of WordPress 3.8. -->';
1233 * Deprecated dashboard widget controls.
1238 function wp_dashboard_incoming_links_output() {}
1241 * Deprecated dashboard secondary output.
1245 function wp_dashboard_secondary_output() {}
1248 * Deprecated dashboard widget controls.
1253 function wp_dashboard_incoming_links() {}
1256 * Deprecated dashboard incoming links control.
1260 function wp_dashboard_incoming_links_control() {}
1263 * Deprecated dashboard plugins control.
1267 function wp_dashboard_plugins() {}
1270 * Deprecated dashboard primary control.
1274 function wp_dashboard_primary_control() {}
1277 * Deprecated dashboard recent comments control.
1281 function wp_dashboard_recent_comments_control() {}
1284 * Deprecated dashboard secondary section.
1288 function wp_dashboard_secondary() {}
1291 * Deprecated dashboard secondary control.
1295 function wp_dashboard_secondary_control() {}
1298 * This was once used to move child posts to a new parent.
1304 * @param int $old_ID
1305 * @param int $new_ID
1307 function _relocate_children( $old_ID, $new_ID ) {
1308 _deprecated_function( __FUNCTION__, '3.9' );
1312 * Add a top-level menu page in the 'objects' section.
1314 * This function takes a capability which will be used to determine whether
1315 * or not a page is included in the menu.
1317 * The function which is hooked in to handle the output of the page must check
1318 * that the user has the required capability as well.
1322 * @deprecated 4.5.0 Use add_menu_page()
1323 * @see add_menu_page()
1324 * @global int $_wp_last_object_menu
1326 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
1327 * @param string $menu_title The text to be used for the menu.
1328 * @param string $capability The capability required for this menu to be displayed to the user.
1329 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
1330 * @param callable $function The function to be called to output the content for this page.
1331 * @param string $icon_url The url to the icon to be used for this menu.
1332 * @return string The resulting page's hook_suffix.
1334 function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1335 _deprecated_function( __FUNCTION__, '4.5', 'add_menu_page()' );
1337 global $_wp_last_object_menu;
1339 $_wp_last_object_menu++;
1341 return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
1345 * Add a top-level menu page in the 'utility' section.
1347 * This function takes a capability which will be used to determine whether
1348 * or not a page is included in the menu.
1350 * The function which is hooked in to handle the output of the page must check
1351 * that the user has the required capability as well.
1355 * @deprecated 4.5.0 Use add_menu_page()
1356 * @see add_menu_page()
1357 * @global int $_wp_last_utility_menu
1359 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
1360 * @param string $menu_title The text to be used for the menu.
1361 * @param string $capability The capability required for this menu to be displayed to the user.
1362 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
1363 * @param callable $function The function to be called to output the content for this page.
1364 * @param string $icon_url The url to the icon to be used for this menu.
1365 * @return string The resulting page's hook_suffix.
1367 function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1368 _deprecated_function( __FUNCTION__, '4.5', 'add_menu_page()' );
1370 global $_wp_last_utility_menu;
1372 $_wp_last_utility_menu++;
1374 return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);