* @see wp_editor()
*/
function tinymce_include() {
- _deprecated_function( __FUNCTION__, '2.1', 'wp_editor()' );
+ _deprecated_function( __FUNCTION__, '2.1.0', 'wp_editor()' );
wp_tiny_mce();
}
*
*/
function documentation_link() {
- _deprecated_function( __FUNCTION__, '2.5' );
+ _deprecated_function( __FUNCTION__, '2.5.0' );
}
/**
* @return array Shrunk dimensions (width, height).
*/
function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
- _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );
+ _deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
}
* @return array Shrunk dimensions (width, height).
*/
function get_udims( $width, $height ) {
- _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' );
+ _deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );
return wp_constrain_dimensions( $width, $height, 128, 96 );
}
* @param array $popular_ids Unused.
*/
function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
- _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' );
+ _deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' );
global $post_ID;
wp_category_checklist( $post_ID );
}
* @param int $default Unused.
*/
function dropdown_link_categories( $default = 0 ) {
- _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' );
+ _deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
global $link_id;
wp_link_category_checklist( $link_id );
}
* @return string Full filesystem path to edit.
*/
function get_real_file_to_edit( $file ) {
- _deprecated_function( __FUNCTION__, '2.9' );
+ _deprecated_function( __FUNCTION__, '2.9.0' );
return WP_CONTENT_DIR . $file;
}
* @return bool|null 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', 'wp_dropdown_categories()' );
+ _deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
if (!$categories )
$categories = get_categories( array('hide_empty' => 0) );
* @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', 'register_setting()' );
+ _deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
register_setting( $option_group, $option_name, $sanitize_callback );
}
* @param callable $sanitize_callback
*/
function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
- _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' );
+ _deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );
unregister_setting( $option_group, $option_name, $sanitize_callback );
}
* @param string $filename
**/
function codepress_get_lang( $filename ) {
- _deprecated_function( __FUNCTION__, '3.0' );
+ _deprecated_function( __FUNCTION__, '3.0.0' );
}
/**
* @deprecated 3.0.0
**/
function codepress_footer_js() {
- _deprecated_function( __FUNCTION__, '3.0' );
+ _deprecated_function( __FUNCTION__, '3.0.0' );
}
/**
* @deprecated 3.0.0
**/
function use_codepress() {
- _deprecated_function( __FUNCTION__, '3.0' );
+ _deprecated_function( __FUNCTION__, '3.0.0' );
}
/**
* @return array List of user IDs.
*/
function get_author_user_ids() {
- _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
global $wpdb;
if ( !is_multisite() )
* @return array|bool List of editable authors. False if no editable users.
*/
function get_editable_authors( $user_id ) {
- _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
global $wpdb;
*
* @deprecated 3.1.0 Use get_users()
*
- * @param int $user_id User ID.
- * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
- * @return mixed
+ * @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', 'get_users()' );
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
global $wpdb;
* @deprecated 3.1.0 Use get_users()
*/
function get_nonauthor_user_ids() {
- _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+ _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
global $wpdb;
* @return WP_User_Search
*/
function __construct( $search_term = '', $page = '', $role = '' ) {
- _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
+ _deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );
$this->search_term = wp_unslash( $search_term );
$this->raw_page = ( '' == $page ) ? false : (int) $page;
endif;
/**
- * Retrieve editable posts from other users.
+ * Retrieves editable posts from other users.
*
+ * @since 2.3.0
* @deprecated 3.1.0 Use get_posts()
* @see get_posts()
*
- * @param int $user_id User ID to not retrieve posts from.
- * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
+ * @param int $user_id User ID to not retrieve posts from.
+ * @param string $type Optional. Post type to retrieve. Accepts 'draft', 'pending' or 'any' (all).
+ * Default 'any'.
* @return array List of posts from others.
*/
-function get_others_unpublished_posts($user_id, $type='any') {
- _deprecated_function( __FUNCTION__, '3.1' );
+function get_others_unpublished_posts( $user_id, $type = 'any' ) {
+ _deprecated_function( __FUNCTION__, '3.1.0' );
global $wpdb;
* @return array List of drafts from other users.
*/
function get_others_drafts($user_id) {
- _deprecated_function( __FUNCTION__, '3.1' );
+ _deprecated_function( __FUNCTION__, '3.1.0' );
return get_others_unpublished_posts($user_id, 'draft');
}
* @return array List of posts with pending review post type from other users.
*/
function get_others_pending($user_id) {
- _deprecated_function( __FUNCTION__, '3.1' );
+ _deprecated_function( __FUNCTION__, '3.1.0' );
return get_others_unpublished_posts($user_id, 'pending');
}
* @see wp_dashboard_quick_press()
*/
function wp_dashboard_quick_press_output() {
- _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
+ _deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' );
wp_dashboard_quick_press();
}
* @staticvar int $num
*/
function wp_tiny_mce( $teeny = false, $settings = false ) {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
static $num = 1;
* @see wp_editor()
*/
function wp_preload_dialogs() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
}
/**
* @see wp_editor()
*/
function wp_print_editor_js() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
}
/**
* @see wp_editor()
*/
function wp_quicktags() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
}
/**
* @see WP_Screen::render_screen_layout()
*/
function screen_layout( $screen ) {
- _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_layout()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' );
$current_screen = get_current_screen();
* @see WP_Screen::render_per_page_options()
*/
function screen_options( $screen ) {
- _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_per_page_options()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_per_page_options()' );
$current_screen = get_current_screen();
* @see WP_Admin_Bar
*/
function favorite_actions() {
- _deprecated_function( __FUNCTION__, '3.2', 'WP_Admin_Bar' );
+ _deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' );
}
/**
* @return null|string
*/
function media_upload_image() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
return wp_media_upload_handler();
}
* @return null|string
*/
function media_upload_audio() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
return wp_media_upload_handler();
}
* @return null|string
*/
function media_upload_video() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
return wp_media_upload_handler();
}
* @return null|string
*/
function media_upload_file() {
- _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
return wp_media_upload_handler();
}
* @return string
*/
function type_url_form_image() {
- _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('image')" );
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('image')" );
return wp_media_insert_url_form( 'image' );
}
* @return string
*/
function type_url_form_audio() {
- _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('audio')" );
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('audio')" );
return wp_media_insert_url_form( 'audio' );
}
* @return string
*/
function type_url_form_video() {
- _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('video')" );
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('video')" );
return wp_media_insert_url_form( 'video' );
}
* @return string
*/
function type_url_form_file() {
- _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('file')" );
+ _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('file')" );
return wp_media_insert_url_form( 'file' );
}
* @param string $help The content of an 'Overview' help tab.
*/
function add_contextual_help( $screen, $help ) {
- _deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' );
+ _deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );
if ( is_string( $screen ) )
$screen = convert_to_screen( $screen );
}
/**
- * Get the allowed themes for the current blog.
+ * Get the allowed themes for the current site.
*
* @since 3.0.0
* @deprecated 3.4.0 Use wp_get_themes()
* @return array $themes Array of allowed themes.
*/
function get_allowed_themes() {
- _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'allowed' => true ) )" );
+ _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );
$themes = wp_get_themes( array( 'allowed' => true ) );
* @return array
*/
function get_broken_themes() {
- _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'errors' => true )" );
+ _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );
$themes = wp_get_themes( array( 'errors' => true ) );
$broken = array();
* @return WP_Theme
*/
function current_theme_info() {
- _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
+ _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
return wp_get_theme();
}
* @deprecated 3.5.0
*/
function _insert_into_post_button( $type ) {
- _deprecated_function( __FUNCTION__, '3.5' );
+ _deprecated_function( __FUNCTION__, '3.5.0' );
}
/**
* @deprecated 3.5.0
*/
function _media_button($title, $icon, $type, $id) {
- _deprecated_function( __FUNCTION__, '3.5' );
+ _deprecated_function( __FUNCTION__, '3.5.0' );
}
/**
* @return object
*/
function get_post_to_edit( $id ) {
- _deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
+ _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );
return get_post( $id, OBJECT, 'edit' );
}
* @return WP_Post Post object containing all the default post data as attributes
*/
function get_default_page_to_edit() {
- _deprecated_function( __FUNCTION__, '3.5', "get_default_post_to_edit( 'page' )" );
+ _deprecated_function( __FUNCTION__, '3.5.0', "get_default_post_to_edit( 'page' )" );
$page = get_default_post_to_edit();
$page->post_type = 'page';
* @return string Thumbnail path on success, Error string on failure.
*/
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
- _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' );
+ _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
}
/**
- * This was once used to display a metabox for the nav menu theme locations.
+ * This was once used to display a meta box for the nav menu theme locations.
*
* Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
*
* @deprecated 3.6.0
*/
function wp_nav_menu_locations_meta_box() {
- _deprecated_function( __FUNCTION__, '3.6' );
+ _deprecated_function( __FUNCTION__, '3.6.0' );
}
/**
* @see Core_Upgrader
*/
function wp_update_core($current, $feedback = '') {
- _deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' );
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );
if ( !empty($feedback) )
add_filter('update_feedback', $feedback);
* @see Plugin_Upgrader
*/
function wp_update_plugin($plugin, $feedback = '') {
- _deprecated_function( __FUNCTION__, '3.7', 'new Plugin_Upgrader();' );
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );
if ( !empty($feedback) )
add_filter('update_feedback', $feedback);
/**
* This was once used to kick-off the Theme Updater.
*
- * Deprecated in favor of instantating a Theme_Upgrader instance directly,
+ * Deprecated in favor of instantiating a Theme_Upgrader instance directly,
* and calling the 'upgrade' method.
* Unused since 2.8.0.
*
* @see Theme_Upgrader
*/
function wp_update_theme($theme, $feedback = '') {
- _deprecated_function( __FUNCTION__, '3.7', 'new Theme_Upgrader();' );
+ _deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );
if ( !empty($feedback) )
add_filter('update_feedback', $feedback);
* @param int|bool $id
*/
function the_attachment_links( $id = false ) {
- _deprecated_function( __FUNCTION__, '3.7' );
+ _deprecated_function( __FUNCTION__, '3.7.0' );
}
/**
* @param int $new_ID
*/
function _relocate_children( $old_ID, $new_ID ) {
- _deprecated_function( __FUNCTION__, '3.9' );
+ _deprecated_function( __FUNCTION__, '3.9.0' );
+}
+
+/**
+ * Add a top-level menu page in the 'objects' section.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @deprecated 4.5.0 Use add_menu_page()
+ * @see add_menu_page()
+ * @global int $_wp_last_object_menu
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
+ */
+function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
+ _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
+
+ global $_wp_last_object_menu;
+
+ $_wp_last_object_menu++;
+
+ return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
+}
+
+/**
+ * Add a top-level menu page in the 'utility' section.
+ *
+ * This function takes a capability which will be used to determine whether
+ * or not a page is included in the menu.
+ *
+ * The function which is hooked in to handle the output of the page must check
+ * that the user has the required capability as well.
+ *
+ * @since 2.7.0
+ *
+ * @deprecated 4.5.0 Use add_menu_page()
+ * @see add_menu_page()
+ * @global int $_wp_last_utility_menu
+ *
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
+ * @param string $menu_title The text to be used for the menu.
+ * @param string $capability The capability required for this menu to be displayed to the user.
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
+ * @param callable $function The function to be called to output the content for this page.
+ * @param string $icon_url The url to the icon to be used for this menu.
+ * @return string The resulting page's hook_suffix.
+ */
+function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
+ _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
+
+ global $_wp_last_utility_menu;
+
+ $_wp_last_utility_menu++;
+
+ return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
+}
+
+/**
+ * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
+ * as they disregard the autocomplete setting on the editor textarea. That can break the editor
+ * when the user navigates to it with the browser's Back button. See #28037
+ *
+ * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
+ *
+ * @since 4.0.0
+ * $deprecated 4.6.0
+ *
+ * @global bool $is_safari
+ * @global bool $is_chrome
+ */
+function post_form_autocomplete_off() {
+ global $is_safari, $is_chrome;
+
+ _deprecated_function( __FUNCTION__, '4.6.0' );
+
+ if ( $is_safari || $is_chrome ) {
+ echo ' autocomplete="off"';
+ }
}