Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r19420 r21050  
    20302030                return $innerHTML;
    20312031
    2032 
    20332032        $innerHTML = esc_attr($post->post_title);
    20342033
    … …  
    21292128        }
    21302129}
    2131 
    21322130
    21332131/**
    … …  
    25672565 *
    25682566 * @since 1.5.0
    2569  * @deprecated 3.1
     2567 * @deprecated 3.1.0
    25702568 * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks.
    25712569 *
    … …  
    25932591 *
    25942592 * @since 1.5.0
    2595  * @deprecated 3.1
     2593 * @deprecated 3.1.0
    25962594 *
    25972595 * @return bool Always return True
    … …  
    26072605 *
    26082606 * @since 2.9.0
    2609  * @deprecated 3.2
     2607 * @deprecated 3.2.0
    26102608 *
    26112609 * @return bool
    … …  
    26212619 *
    26222620 * @since 2.1.0
    2623  * @deprecated 3.3
     2621 * @deprecated 3.3.0
     2622 * @deprecated Use wp_editor()
     2623 * @see wp_editor()
    26242624 *
    26252625 * @param string $content Textarea content.
    … …  
    26302630 */
    26312631function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2, $extended = true) {
     2632        _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
    26322633
    26332634        wp_editor( $content, $id, array( 'media_buttons' => $media_buttons ) );
    … …  
    26392640 *
    26402641 * @since 3.0.0
     2642 * @deprecated 3.3.0
     2643 *
    26412644 * @param array $ids User ID numbers list.
    26422645 * @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
    … …  
    26712674 * @since 2.3.0
    26722675 * @deprecated 3.3.0
    2673  * @uses sanitize_user_field() Used to sanitize the fields.
    26742676 *
    26752677 * @param object|array $user The User Object or Array
    … …  
    27082710 *
    27092711 * @since 2.8.0
    2710  * @deprecated 3.3
     2712 * @deprecated 3.3.0
    27112713 *
    27122714 * @param string $title Optional. Link title format.
    … …  
    27482750 *
    27492751 * @since 2.8.0
    2750  * @deprecated 3.3
     2752 * @deprecated 3.3.0
    27512753 *
    27522754 * @param string $title Optional. Link title format.
    … …  
    27642766 *
    27652767 * @since 2.8.0
    2766  * @deprecated 3.3
     2768 * @deprecated 3.3.0
    27672769 *
    27682770 * @return string
    … …  
    27792781 *
    27802782 * @since 2.8.0
    2781  * @deprecated 3.3
     2783 * @deprecated 3.3.0
    27822784 */
    27832785function index_rel_link() {
    … …  
    27912793 *
    27922794 * @since 2.8.0
    2793  * @deprecated 3.3
     2795 * @deprecated 3.3.0
    27942796 *
    27952797 * @param string $title Optional. Link title format.
    … …  
    28222824 *
    28232825 * @since 2.8.0
    2824  * @deprecated 3.3
     2826 * @deprecated 3.3.0
    28252827 */
    28262828function parent_post_rel_link($title = '%title') {
    … …  
    28342836 *
    28352837 * @since 3.2.0
    2836  * @deprecated 3.3
     2838 * @deprecated 3.3.0
    28372839 */
    28382840function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
    … …  
    28552857 *
    28562858 * @since MU
    2857  * @deprecated 3.3
     2859 * @deprecated 3.3.0
    28582860 * @deprecated Use is_user_member_of_blog()
    28592861 * @see is_user_member_of_blog()
    … …  
    28672869        return is_user_member_of_blog( get_current_user_id(), $blog_id );
    28682870}
     2871
     2872/**
     2873 * Open the file handle for debugging.
     2874 *
     2875 * @since 0.71
     2876 * @deprecated Use error_log()
     2877 * @link http://www.php.net/manual/en/function.error-log.php
     2878 * @deprecated 3.4.0
     2879 */
     2880function debug_fopen( $filename, $mode ) {
     2881        _deprecated_function( __FUNCTION__, 'error_log()' );
     2882        return false;
     2883}
     2884
     2885/**
     2886 * Write contents to the file used for debugging.
     2887 *
     2888 * @since 0.71
     2889 * @deprecated Use error_log() instead.
     2890 * @link http://www.php.net/manual/en/function.error-log.php
     2891 * @deprecated 3.4.0
     2892 */
     2893function debug_fwrite( $fp, $string ) {
     2894        _deprecated_function( __FUNCTION__, 'error_log()' );
     2895        if ( ! empty( $GLOBALS['debug'] ) )
     2896                error_log( $string );
     2897}
     2898
     2899/**
     2900 * Close the debugging file handle.
     2901 *
     2902 * @since 0.71
     2903 * @deprecated Use error_log()
     2904 * @link http://www.php.net/manual/en/function.error-log.php
     2905 * @deprecated 3.4.0
     2906 */
     2907function debug_fclose( $fp ) {
     2908        _deprecated_function( __FUNCTION__, 'error_log()' );
     2909}
     2910
     2911/**
     2912 * Retrieve list of themes with theme data in theme directory.
     2913 *
     2914 * The theme is broken, if it doesn't have a parent theme and is missing either
     2915 * style.css and, or index.php. If the theme has a parent theme then it is
     2916 * broken, if it is missing style.css; index.php is optional.
     2917 *
     2918 * @since 1.5.0
     2919 * @deprecated 3.4.0
     2920 * @deprecated Use wp_get_themes()
     2921 * @see wp_get_themes()
     2922 *
     2923 * @return array Theme list with theme data.
     2924 */
     2925function get_themes() {
     2926        _deprecated_function( __FUNCTION__, '3.4', 'wp_get_themes()' );
     2927
     2928        global $wp_themes;
     2929        if ( isset( $wp_themes ) )
     2930                return $wp_themes;
     2931
     2932        $themes = wp_get_themes();
     2933        $wp_themes = array();
     2934
     2935        foreach ( $themes as $theme ) {
     2936                $name = $theme->get('Name');
     2937                if ( isset( $wp_themes[ $name ] ) )
     2938                        $wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
     2939                else
     2940                        $wp_themes[ $name ] = $theme;
     2941        }
     2942
     2943        return $wp_themes;
     2944}
     2945
     2946/**
     2947 * Retrieve theme data.
     2948 *
     2949 * @since 1.5.0
     2950 * @deprecated 3.4.0
     2951 * @deprecated Use wp_get_theme()
     2952 * @see wp_get_theme()
     2953 *
     2954 * @param string $theme Theme name.
     2955 * @return array|null Null, if theme name does not exist. Theme data, if exists.
     2956 */
     2957function get_theme( $theme ) {
     2958        _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme( $stylesheet )' );
     2959
     2960        $themes = get_themes();
     2961        if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
     2962                return $themes[ $theme ];
     2963        return null;
     2964}
     2965
     2966/**
     2967 * Retrieve current theme name.
     2968 *
     2969 * @since 1.5.0
     2970 * @deprecated 3.4.0
     2971 * @deprecated Use (string) wp_get_theme()
     2972 * @see wp_get_theme()
     2973 *
     2974 * @return string
     2975 */
     2976function get_current_theme() {
     2977        _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
     2978
     2979        if ( $theme = get_option( 'current_theme' ) )
     2980                return $theme;
     2981
     2982        return wp_get_theme()->get('Name');
     2983}
     2984
     2985/**
     2986 * Accepts matches array from preg_replace_callback in wpautop() or a string.
     2987 *
     2988 * Ensures that the contents of a <<pre>>...<</pre>> HTML block are not
     2989 * converted into paragraphs or line-breaks.
     2990 *
     2991 * @since 1.2.0
     2992 * @deprecated 3.4.0
     2993 *
     2994 * @param array|string $matches The array or string
     2995 * @return string The pre block without paragraph/line-break conversion.
     2996 */
     2997function clean_pre($matches) {
     2998        _deprecated_function( __FUNCTION__, '3.4' );
     2999
     3000        if ( is_array($matches) )
     3001                $text = $matches[1] . $matches[2] . "</pre>";
     3002        else
     3003                $text = $matches;
     3004
     3005        $text = str_replace(array('<br />', '<br/>', '<br>'), array('', '', ''), $text);
     3006        $text = str_replace('<p>', "\n", $text);
     3007        $text = str_replace('</p>', '', $text);
     3008
     3009        return $text;
     3010}
     3011
     3012
     3013/**
     3014 * Add callbacks for image header display.
     3015 *
     3016 * @since 2.1.0
     3017 * @deprecated 3.4.0
     3018 * @deprecated Use add_theme_support('custom-header', $args)
     3019 * @see add_theme_support()
     3020 *
     3021 * @param callback $wp_head_callback Call on 'wp_head' action.
     3022 * @param callback $admin_head_callback Call on custom header administration screen.
     3023 * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
     3024 */
     3025function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
     3026        _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' );
     3027        $args = array(
     3028                'wp-head-callback'    => $wp_head_callback,
     3029                'admin-head-callback' => $admin_head_callback,
     3030        );
     3031        if ( $admin_preview_callback )
     3032                $args['admin-preview-callback'] = $admin_preview_callback;
     3033        return add_theme_support( 'custom-header', $args );
     3034}
     3035
     3036/**
     3037 * Remove image header support.
     3038 *
     3039 * @since 3.1.0
     3040 * @deprecated 3.4.0
     3041 * @deprecated Use remove_theme_support('custom-header')
     3042 * @see remove_theme_support()
     3043 *
     3044 * @return bool Whether support was removed.
     3045 */
     3046function remove_custom_image_header() {
     3047        _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-header\' )' );
     3048        return remove_theme_support( 'custom-header' );
     3049}
     3050
     3051/**
     3052 * Add callbacks for background image display.
     3053 *
     3054 * @since 3.0.0
     3055 * @deprecated 3.4.0
     3056 * @deprecated Use add_theme_support('custom-background, $args)
     3057 * @see add_theme_support()
     3058 *
     3059 * @param callback $wp_head_callback Call on 'wp_head' action.
     3060 * @param callback $admin_head_callback Call on custom background administration screen.
     3061 * @param callback $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
     3062 */
     3063function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
     3064        _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-background\', $args )' );
     3065        $args = array();
     3066        if ( $wp_head_callback )
     3067                $args['wp-head-callback'] = $wp_head_callback;
     3068        if ( $admin_head_callback )
     3069                $args['admin-head-callback'] = $admin_head_callback;
     3070        if ( $admin_preview_callback )
     3071                $args['admin-preview-callback'] = $admin_preview_callback;
     3072        return add_theme_support( 'custom-background', $args );
     3073}
     3074
     3075/**
     3076 * Remove custom background support.
     3077 *
     3078 * @since 3.1.0
     3079 * @see add_custom_background()
     3080 *
     3081 * @return bool Whether support was removed.
     3082 */
     3083function remove_custom_background() {
     3084        _deprecated_function( __FUNCTION__, '3.4', 'remove_theme_support( \'custom-background\' )' );
     3085        return remove_theme_support( 'custom-background' );
     3086}
     3087
     3088/**
     3089 * Retrieve theme data from parsed theme file.
     3090 *
     3091 * @since 1.5.0
     3092 * @deprecated 3.4.0
     3093 * @deprecated Use wp_get_theme()
     3094 * @see wp_get_theme()
     3095 *
     3096 * @param string $theme_file Theme file path.
     3097 * @return array Theme data.
     3098 */
     3099function get_theme_data( $theme_file ) {
     3100        _deprecated_function( __FUNCTION__, 3.4, 'wp_get_theme()' );
     3101        $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
     3102
     3103        $theme_data = array(
     3104                'Name' => $theme->get('Name'),
     3105                'URI' => $theme->display('ThemeURI', true, false),
     3106                'Description' => $theme->display('Description', true, false),
     3107                'Author' => $theme->display('Author', true, false),
     3108                'AuthorURI' => $theme->display('AuthorURI', true, false),
     3109                'Version' => $theme->get('Version'),
     3110                'Template' => $theme->get('Template'),
     3111                'Status' => $theme->get('Status'),
     3112                'Tags' => $theme->get('Tags'),
     3113                'Title' => $theme->get('Name'),
     3114                'AuthorName' => $theme->get('Author'),
     3115        );
     3116
     3117        foreach ( apply_filters( 'extra_theme_headers', array() ) as $extra_header ) {
     3118                if ( ! isset( $theme_data[ $extra_header ] ) )
     3119                        $theme_data[ $extra_header ] = $theme->get( $extra_header );
     3120        }
     3121
     3122        return $theme_data;
     3123}
     3124
     3125/**
     3126 * Alias of update_post_cache().
     3127 *
     3128 * @see update_post_cache() Posts and pages are the same, alias is intentional
     3129 *
     3130 * @since 1.5.1
     3131 * @deprecated 3.4.0
     3132 *
     3133 * @param array $pages list of page objects
     3134 */
     3135function update_page_cache( &$pages ) {
     3136        _deprecated_function( __FUNCTION__, 3.4, 'update_post_cache()' );
     3137
     3138        update_post_cache( $pages );
     3139}
     3140
     3141/**
     3142 * Will clean the page in the cache.
     3143 *
     3144 * Clean (read: delete) page from cache that matches $id. Will also clean cache
     3145 * associated with 'all_page_ids' and 'get_pages'.
     3146 *
     3147 * @since 2.0.0
     3148 * @deprecated 3.4.0
     3149 *
     3150 * @uses do_action() Will call the 'clean_page_cache' hook action.
     3151 *
     3152 * @param int $id Page ID to clean
     3153 */
     3154function clean_page_cache( $id ) {
     3155        _deprecated_function( __FUNCTION__, 3.4, 'clean_post_cache()' );
     3156
     3157        clean_post_cache( $id );
     3158}
Note: See TracChangeset for help on using the changeset viewer.