]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/deprecated.php
WordPress 3.4
[autoinstalls/wordpress.git] / wp-includes / deprecated.php
index 1ccddba3497b4b4eb8c962fc1080a2e5e94f1140..43523ca6980d58a8d8f517fae6157700b8e710d2 100644 (file)
@@ -2029,7 +2029,6 @@ function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false)
        if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
                return $innerHTML;
 
-
        $innerHTML = esc_attr($post->post_title);
 
        return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
@@ -2129,7 +2128,6 @@ function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false
        }
 }
 
-
 /**
  * Escaping for HTML attributes.
  *
@@ -2566,7 +2564,7 @@ function is_term( $term, $taxonomy = '', $parent = 0 ) {
  * Is the current admin page generated by a plugin?
  *
  * @since 1.5.0
- * @deprecated 3.1
+ * @deprecated 3.1.0
  * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks.
  *
  * @global $plugin_page
@@ -2592,7 +2590,7 @@ function is_plugin_page() {
  * for updating the category cache.
  *
  * @since 1.5.0
- * @deprecated 3.1
+ * @deprecated 3.1.0
  *
  * @return bool Always return True
  */
@@ -2606,7 +2604,7 @@ function update_category_cache() {
  * Check for PHP timezone support
  *
  * @since 2.9.0
- * @deprecated 3.2
+ * @deprecated 3.2.0
  *
  * @return bool
  */
@@ -2620,7 +2618,9 @@ function wp_timezone_supported() {
  * Display editor: TinyMCE, HTML, or both.
  *
  * @since 2.1.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
+ * @deprecated Use wp_editor()
+ * @see wp_editor()
  *
  * @param string $content Textarea content.
  * @param string $id Optional, default is 'content'. HTML ID attribute value.
@@ -2629,6 +2629,7 @@ function wp_timezone_supported() {
  * @param int $tab_index Optional, not used
  */
 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
+       _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
 
        wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );
        return;
@@ -2638,6 +2639,8 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button
  * Perform the query to get the $metavalues array(s) needed by _fill_user and _fill_many_users
  *
  * @since 3.0.0
+ * @deprecated 3.3.0
+ *
  * @param array $ids User ID numbers list.
  * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
  */
@@ -2670,7 +2673,6 @@ function get_user_metavalues($ids) {
  *
  * @since 2.3.0
  * @deprecated 3.3.0
- * @uses sanitize_user_field() Used to sanitize the fields.
  *
  * @param object|array $user The User Object or Array
  * @param string $context Optional, default is 'display'. How to sanitize user fields.
@@ -2707,7 +2709,7 @@ function sanitize_user_object($user, $context = 'display') {
  * Can either be start or end post relational link.
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  *
  * @param string $title Optional. Link title format.
  * @param bool $in_same_cat Optional. Whether link should be in a same category.
@@ -2747,7 +2749,7 @@ function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $ex
  * Display relational link for the first post.
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  *
  * @param string $title Optional. Link title format.
  * @param bool $in_same_cat Optional. Whether link should be in a same category.
@@ -2763,7 +2765,7 @@ function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_
  * Get site index relational link.
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  *
  * @return string
  */
@@ -2778,7 +2780,7 @@ function get_index_rel_link() {
  * Display relational link for the site index.
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  */
 function index_rel_link() {
        _deprecated_function( __FUNCTION__, '3.3' );
@@ -2790,7 +2792,7 @@ function index_rel_link() {
  * Get parent post relational link.
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  *
  * @param string $title Optional. Link title format.
  * @return string
@@ -2821,7 +2823,7 @@ function get_parent_post_rel_link($title = '%title') {
  * Display relational link for parent item
  *
  * @since 2.8.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  */
 function parent_post_rel_link($title = '%title') {
        _deprecated_function( __FUNCTION__, '3.3' );
@@ -2833,7 +2835,7 @@ function parent_post_rel_link($title = '%title') {
  * Add the "Dashboard"/"Visit Site" menu.
  *
  * @since 3.2.0
- * @deprecated 3.3
+ * @deprecated 3.3.0
  */
 function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
        _deprecated_function( __FUNCTION__, '3.3' );
@@ -2854,7 +2856,7 @@ function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
  * Checks if the current user belong to a given blog.
  *
  * @since MU
- * @deprecated 3.3
+ * @deprecated 3.3.0
  * @deprecated Use is_user_member_of_blog()
  * @see is_user_member_of_blog()
  *
@@ -2866,3 +2868,291 @@ function is_blog_user( $blog_id = 0 ) {
 
        return is_user_member_of_blog( get_current_user_id(), $blog_id );
 }
+
+/**
+ * Open the file handle for debugging.
+ *
+ * @since 0.71
+ * @deprecated Use error_log()
+ * @link http://www.php.net/manual/en/function.error-log.php
+ * @deprecated 3.4.0
+ */
+function debug_fopen( $filename, $mode ) {
+       _deprecated_function( __FUNCTION__, 'error_log()' );
+       return false;
+}
+
+/**
+ * Write contents to the file used for debugging.
+ *
+ * @since 0.71
+ * @deprecated Use error_log() instead.
+ * @link http://www.php.net/manual/en/function.error-log.php
+ * @deprecated 3.4.0
+ */
+function debug_fwrite( $fp, $string ) {
+       _deprecated_function( __FUNCTION__, 'error_log()' );
+       if ( ! empty( $GLOBALS['debug'] ) )
+               error_log( $string );
+}
+
+/**
+ * Close the debugging file handle.
+ *
+ * @since 0.71
+ * @deprecated Use error_log()
+ * @link http://www.php.net/manual/en/function.error-log.php
+ * @deprecated 3.4.0
+ */
+function debug_fclose( $fp ) {
+       _deprecated_function( __FUNCTION__, 'error_log()' );
+}
+
+/**
+ * Retrieve list of themes with theme data in theme directory.
+ *
+ * The theme is broken, if it doesn't have a parent theme and is missing either
+ * style.css and, or index.php. If the theme has a parent theme then it is
+ * broken, if it is missing style.css; index.php is optional.
+ *
+ * @since 1.5.0
+ * @deprecated 3.4.0
+ * @deprecated Use wp_get_themes()
+ * @see wp_get_themes()
+ *
+ * @return array Theme list with theme data.
+ */
+function get_themes() {
+       _deprecated_function( __FUNCTION__, '3.4', 'wp_get_themes()' );
+
+       global $wp_themes;
+       if ( isset( $wp_themes ) )
+               return $wp_themes;
+
+       $themes = wp_get_themes();
+       $wp_themes = array();
+
+       foreach ( $themes as $theme ) {
+               $name = $theme->get('Name');
+               if ( isset( $wp_themes[ $name ] ) )
+                       $wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
+               else
+                       $wp_themes[ $name ] = $theme;
+       }
+
+       return $wp_themes;
+}
+
+/**
+ * Retrieve theme data.
+ *
+ * @since 1.5.0
+ * @deprecated 3.4.0
+ * @deprecated Use wp_get_theme()
+ * @see wp_get_theme()
+ *
+ * @param string $theme Theme name.
+ * @return array|null Null, if theme name does not exist. Theme data, if exists.
+ */
+function get_theme( $theme ) {
+       _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' );
+
+       $themes = get_themes();
+       if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
+               return $themes[ $theme ];
+       return null;
+}
+
+/**
+ * Retrieve current theme name.
+ *
+ * @since 1.5.0
+ * @deprecated 3.4.0
+ * @deprecated Use (string) wp_get_theme()
+ * @see wp_get_theme()
+ *
+ * @return string
+ */
+function get_current_theme() {
+       _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
+
+       if ( $theme = get_option( 'current_theme' ) )
+               return $theme;
+
+       return wp_get_theme()->get('Name');
+}
+
+/**
+ * Accepts matches array from preg_replace_callback in wpautop() or a string.
+ *
+ * Ensures that the contents of a <<pre>>...<</pre>> HTML block are not
+ * converted into paragraphs or line-breaks.
+ *
+ * @since 1.2.0
+ * @deprecated 3.4.0
+ *
+ * @param array|string $matches The array or string
+ * @return string The pre block without paragraph/line-break conversion.
+ */
+function clean_pre($matches) {
+       _deprecated_function( __FUNCTION__, '3.4' );
+
+       if ( is_array($matches) )
+               $text = $matches[1] . $matches[2] . "</pre>";
+       else
+               $text = $matches;
+
+       $text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
+       $text = str_replace('<p>', "\n", $text);
+       $text = str_replace('</p>', '', $text);
+
+       return $text;
+}
+
+
+/**
+ * Add callbacks for image header display.
+ *
+ * @since 2.1.0
+ * @deprecated 3.4.0
+ * @deprecated Use add_theme_support('custom-header', $args)
+ * @see add_theme_support()
+ *
+ * @param callback $wp_head_callback Call on 'wp_head' action.
+ * @param callback $admin_head_callback Call on custom header administration screen.
+ * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
+ */
+function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
+       _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' );
+       $args = array(
+               'wp-head-callback'    => $wp_head_callback,
+               'admin-head-callback' => $admin_head_callback,
+       );
+       if ( $admin_preview_callback )
+               $args['admin-preview-callback'] = $admin_preview_callback;
+       return add_theme_support( 'custom-header', $args );
+}
+
+/**
+ * Remove image header support.
+ *
+ * @since 3.1.0
+ * @deprecated 3.4.0
+ * @deprecated Use remove_theme_support('custom-header')
+ * @see remove_theme_support()
+ *
+ * @return bool Whether support was removed.
+ */
+function remove_custom_image_header() {
+       _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-header\' )' );
+       return remove_theme_support( 'custom-header' );
+}
+
+/**
+ * Add callbacks for background image display.
+ *
+ * @since 3.0.0
+ * @deprecated 3.4.0
+ * @deprecated Use add_theme_support('custom-background, $args)
+ * @see add_theme_support()
+ *
+ * @param callback $wp_head_callback Call on 'wp_head' action.
+ * @param callback $admin_head_callback Call on custom background administration screen.
+ * @param callback $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
+ */
+function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
+       _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' );
+       $args = array();
+       if ( $wp_head_callback )
+               $args['wp-head-callback'] = $wp_head_callback;
+       if ( $admin_head_callback )
+               $args['admin-head-callback'] = $admin_head_callback;
+       if ( $admin_preview_callback )
+               $args['admin-preview-callback'] = $admin_preview_callback;
+       return add_theme_support( 'custom-background', $args );
+}
+
+/**
+ * Remove custom background support.
+ *
+ * @since 3.1.0
+ * @see add_custom_background()
+ *
+ * @return bool Whether support was removed.
+ */
+function remove_custom_background() {
+       _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-background\' )' );
+       return remove_theme_support( 'custom-background' );
+}
+
+/**
+ * Retrieve theme data from parsed theme file.
+ *
+ * @since 1.5.0
+ * @deprecated 3.4.0
+ * @deprecated Use wp_get_theme()
+ * @see wp_get_theme()
+ *
+ * @param string $theme_file Theme file path.
+ * @return array Theme data.
+ */
+function get_theme_data( $theme_file ) {
+       _deprecated_function( __FUNCTION__, 3.4, 'wp_get_theme()' );
+       $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
+
+       $theme_data = array(
+               'Name' => $theme->get('Name'),
+               'URI' => $theme->display('ThemeURI', true, false),
+               'Description' => $theme->display('Description', true, false),
+               'Author' => $theme->display('Author', true, false),
+               'AuthorURI' => $theme->display('AuthorURI', true, false),
+               'Version' => $theme->get('Version'),
+               'Template' => $theme->get('Template'),
+               'Status' => $theme->get('Status'),
+               'Tags' => $theme->get('Tags'),
+               'Title' => $theme->get('Name'),
+               'AuthorName' => $theme->get('Author'),
+       );
+
+       foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
+               if ( ! isset( $theme_data[ $extra_header ] ) )
+                       $theme_data[ $extra_header ] = $theme->get( $extra_header );
+       }
+
+       return $theme_data;
+}
+
+/**
+ * Alias of update_post_cache().
+ *
+ * @see update_post_cache() Posts and pages are the same, alias is intentional
+ *
+ * @since 1.5.1
+ * @deprecated 3.4.0
+ *
+ * @param array $pages list of page objects
+ */
+function update_page_cache( &$pages ) {
+       _deprecated_function( __FUNCTION__, 3.4, 'update_post_cache()' );
+
+       update_post_cache( $pages );
+}
+
+/**
+ * Will clean the page in the cache.
+ *
+ * Clean (read: delete) page from cache that matches $id. Will also clean cache
+ * associated with 'all_page_ids' and 'get_pages'.
+ *
+ * @since 2.0.0
+ * @deprecated 3.4.0
+ *
+ * @uses do_action() Will call the 'clean_page_cache' hook action.
+ *
+ * @param int $id Page ID to clean
+ */
+function clean_page_cache( $id ) {
+       _deprecated_function( __FUNCTION__, 3.4, 'clean_post_cache()' );
+
+       clean_post_cache( $id );
+}