]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/deprecated.php
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-admin / includes / deprecated.php
index 747b228d535897b2aa674c412f35371dbaddf966..399577ed4b75f437f01e28d69f3ce73a9aeed2e3 100644 (file)
@@ -42,18 +42,36 @@ function documentation_link() {
  * @since 2.0.0
  * @deprecated 3.0.0
  * @deprecated Use wp_constrain_dimensions()
  * @since 2.0.0
  * @deprecated 3.0.0
  * @deprecated 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
  *
  * @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 mixed Array(height,width) of shrunk dimensions.
+ * @return array Shrunk dimensions (width, height).
  */
 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
        _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );
        return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
 }
 
  */
 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
        _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );
        return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
 }
 
+/**
+ * Calculated the new dimensions for a downsampled image.
+ *
+ * @since 2.0.0
+ * @deprecated 3.5.0
+ * @deprecated 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', 'wp_constrain_dimensions()' );
+       return wp_constrain_dimensions( $width, $height, 128, 96 );
+}
+
 /**
  * {@internal Missing Short Description}}
  *
 /**
  * {@internal Missing Short Description}}
  *
@@ -249,7 +267,8 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p
 
        global $wpdb;
 
 
        global $wpdb;
 
-       $user = new WP_User( $user_id );
+       if ( ! $user = get_userdata( $user_id ) )
+               return array();
        $post_type_obj = get_post_type_object($post_type);
 
        if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
        $post_type_obj = get_post_type_object($post_type);
 
        if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
@@ -453,14 +472,13 @@ class WP_User_Search {
        function WP_User_Search ($search_term = '', $page = '', $role = '') {
                _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
 
        function WP_User_Search ($search_term = '', $page = '', $role = '') {
                _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
 
-               $this->search_term = stripslashes( $search_term );
+               $this->search_term = wp_unslash( $search_term );
                $this->raw_page = ( '' == $page ) ? false : (int) $page;
                $this->page = (int) ( '' == $page ) ? 1 : $page;
                $this->role = $role;
 
                $this->prepare_query();
                $this->query();
                $this->raw_page = ( '' == $page ) ? false : (int) $page;
                $this->page = (int) ( '' == $page ) ? 1 : $page;
                $this->role = $role;
 
                $this->prepare_query();
                $this->query();
-               $this->prepare_vars_for_template_usage();
                $this->do_paging();
        }
 
                $this->do_paging();
        }
 
@@ -531,9 +549,7 @@ class WP_User_Search {
         * @since 2.1.0
         * @access public
         */
         * @since 2.1.0
         * @access public
         */
-       function prepare_vars_for_template_usage() {
-               $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
-       }
+       function prepare_vars_for_template_usage() {}
 
        /**
         * {@internal Missing Short Description}}
 
        /**
         * {@internal Missing Short Description}}
@@ -938,4 +954,72 @@ function current_theme_info() {
        _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
 
        return wp_get_theme();
        _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' );
 
        return wp_get_theme();
-}
\ No newline at end of file
+}
+
+/**
+ * This was once used to display an 'Insert into Post' button. Now it is deprecated and stubbed.
+ *
+ * @deprecated 3.5.0
+ */
+function _insert_into_post_button( $type ) {
+       _deprecated_function( __FUNCTION__, '3.5' );
+}
+
+/**
+ * This was once used to display a media button. Now it is deprecated and stubbed.
+ *
+ * @deprecated 3.5.0
+ */
+function _media_button($title, $icon, $type, $id) {
+       _deprecated_function( __FUNCTION__, '3.5' );
+}
+
+/**
+ * Get an existing post and format it for editing.
+ *
+ * @since 2.0.0
+ * @deprecated 3.5.0
+ *
+ * @param int $id
+ * @return object
+ */
+function get_post_to_edit( $id ) {
+       _deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
+
+       return get_post( $id, OBJECT, 'edit' );
+}
+
+/**
+ * Get the default page information to use.
+ *
+ * @since 2.5.0
+ * @deprecated 3.5.0
+ * @deprecated Use get_default_post_to_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' )" );
+
+       $page = get_default_post_to_edit();
+       $page->post_type = 'page';
+       return $page;
+}
+
+/**
+ * This was once used to create a thumbnail from an Image given a maximum side size.
+ *
+ * @since 1.2.0
+ * @deprecated 3.5.0
+ * @deprecated Use image_resize()
+ * @see image_resize()
+ *
+ * @param mixed $file Filename of the original image, Or attachment id.
+ * @param int $max_side Maximum length of a single side for the thumbnail.
+ * @param mixed $deprecated Never used.
+ * @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()' );
+       return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
+}