* Deprecated admin functions from past WordPress versions. You shouldn't use these
* functions and look for the alternatives instead. The functions will be removed
* Deprecated functions come here to die.
* @deprecated 2.1.0 Use wp_editor()
function tinymce_include() {
_deprecated_function( __FUNCTION__, '2.1.0', 'wp_editor()' );
function documentation_link() {
_deprecated_function( __FUNCTION__, '2.5.0' );
* Calculates the new dimensions for a downsampled image.
* @deprecated 3.0.0 Use wp_constrain_dimensions()
* @see wp_constrain_dimensions()
* @param int $width Current width of the image
* @param int $height Current height of the image
* @param int $wmax Maximum wanted width
* @param int $hmax Maximum wanted height
* @return array Shrunk dimensions (width, height).
function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
* Calculated the new dimensions for a downsampled image.
* @deprecated 3.5.0 Use wp_constrain_dimensions()
* @see wp_constrain_dimensions()
* @param int $width Current width of the image
* @param int $height Current height of the image
* @return array Shrunk dimensions (width, height).
function get_udims( $width, $height ) {
_deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );
return wp_constrain_dimensions( $width, $height, 128, 96 );
* Legacy function used to generate the categories checklist control.
* @deprecated 2.6.0 Use wp_category_checklist()
* @see wp_category_checklist()
* @param int $default Unused.
* @param int $parent Unused.
* @param array $popular_ids Unused.
function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
_deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' );
wp_category_checklist( $post_ID );
* Legacy function used to generate a link categories checklist control.
* @deprecated 2.6.0 Use wp_link_category_checklist()
* @see wp_link_category_checklist()
* @param int $default Unused.
function dropdown_link_categories( $default = 0 ) {
_deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
wp_link_category_checklist( $link_id );
* Get the real filesystem path to a file to edit within the admin.
* @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
* @param string $file Filesystem path relative to the wp-content directory.
* @return string Full filesystem path to edit.
function get_real_file_to_edit( $file ) {
_deprecated_function( __FUNCTION__, '2.9.0' );
return WP_CONTENT_DIR . $file;
* Legacy function used for generating a categories drop-down control.
* @deprecated 3.0.0 Use wp_dropdown_categories()
* @see wp_dropdown_categories()
* @param int $currentcat Optional. ID of the current category. Default 0.
* @param int $currentparent Optional. Current parent category ID. Default 0.
* @param int $parent Optional. Parent ID to retrieve categories for. Default 0.
* @param int $level Optional. Number of levels deep to display. Default 0.
* @param array $categories Optional. Categories to include in the control. Default 0.
* @return void|false Void on success, false if no categories were found.
function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
$categories = get_categories( array('hide_empty' => 0) );
foreach ( $categories as $category ) {
if ( $currentcat != $category->term_id && $parent == $category->parent) {
$pad = str_repeat( '– ', $level );
$category->name = esc_html( $category->name );
echo "\n\t<option value='$category->term_id'";
if ( $currentparent == $category->term_id )
echo " selected='selected'";
echo ">$pad$category->name</option>";
wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
* Register a setting and its sanitization callback
* @deprecated 3.0.0 Use register_setting()
* @see register_setting()
* @param string $option_group A settings group name. Should correspond to an allowed option key name.
* Default allowed option key names include 'general', 'discussion', 'media',
* 'reading', 'writing', 'misc', 'options', and 'privacy'.
* @param string $option_name The name of an option to sanitize and save.
* @param callable $sanitize_callback A callback function that sanitizes the option's value.
function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
register_setting( $option_group, $option_name, $sanitize_callback );
* @deprecated 3.0.0 Use unregister_setting()
* @see unregister_setting()
* @param string $option_group
* @param string $option_name
* @param callable $sanitize_callback
function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );
unregister_setting( $option_group, $option_name, $sanitize_callback );
* Determines the language to use for CodePress syntax highlighting.
* @param string $filename
function codepress_get_lang( $filename ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
* Adds JavaScript required to make CodePress work on the theme/plugin editors.
function codepress_footer_js() {
_deprecated_function( __FUNCTION__, '3.0.0' );
* Determine whether to use CodePress.
function use_codepress() {
_deprecated_function( __FUNCTION__, '3.0.0' );
* @deprecated 3.1.0 Use get_users()
* @global wpdb $wpdb WordPress database abstraction object.
* @return array List of user IDs.
function get_author_user_ids() {
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
$level_key = $wpdb->get_blog_prefix() . 'user_level';
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
* Gets author users who can edit posts.
* @deprecated 3.1.0 Use get_users()
* @global wpdb $wpdb WordPress database abstraction object.
* @param int $user_id User ID.
* @return array|false List of editable authors. False if no editable users.
function get_editable_authors( $user_id ) {
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
$editable = get_editable_user_ids( $user_id );
$editable = join(',', $editable);
$authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
return apply_filters('get_editable_authors', $authors);
* Gets the IDs of any users who can edit posts.
* @deprecated 3.1.0 Use get_users()
* @global wpdb $wpdb WordPress database abstraction object.
* @param int $user_id User ID.
* @param bool $exclude_zeros Optional. Whether to exclude zeroes. Default true.
* @return array Array of editable user IDs, empty array otherwise.
function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
if ( ! $user = get_userdata( $user_id ) )
$post_type_obj = get_post_type_object($post_type);
if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
$level_key = $wpdb->get_blog_prefix() . 'user_level';
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
$query .= " AND meta_value != '0'";
return $wpdb->get_col( $query );
* Gets all users who are not authors.
* @deprecated 3.1.0 Use get_users()
* @global wpdb $wpdb WordPress database abstraction object.
function get_nonauthor_user_ids() {
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
$level_key = $wpdb->get_blog_prefix() . 'user_level';
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
if ( ! class_exists( 'WP_User_Search', false ) ) :
* WordPress User Search class.
* @deprecated 3.1.0 Use WP_User_Query
* {@internal Missing Description}}
* {@internal Missing Description}}
* Role name that users have.
* Amount of users to display per page.
var $users_per_page = 50;
* {@internal Missing Description}}
* {@internal Missing Description}}
* {@internal Missing Description}}
* {@internal Missing Description}}
* {@internal Missing Description}}
* {@internal Missing Description}}
* {@internal Missing Description}}
var $total_users_for_query = 0;
* {@internal Missing Description}}
var $too_many_total_users = false;
* {@internal Missing Description}}
* {@internal Missing Description}}
* PHP5 Constructor - Sets up the object properties.
* @param string $search_term Search terms string.
* @param int $page Optional. Page ID.
* @param string $role Role name.
function __construct( $search_term = '', $page = '', $role = '' ) {
_deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );
$this->search_term = wp_unslash( $search_term );
$this->raw_page = ( '' == $page ) ? false : (int) $page;
$this->page = (int) ( '' == $page ) ? 1 : $page;