40 * Calculates the new dimensions for a downsampled image. |
40 * Calculates the new dimensions for a downsampled image. |
41 * |
41 * |
42 * @since 2.0.0 |
42 * @since 2.0.0 |
43 * @deprecated 3.0.0 |
43 * @deprecated 3.0.0 |
44 * @deprecated Use wp_constrain_dimensions() |
44 * @deprecated Use wp_constrain_dimensions() |
|
45 * @see wp_constrain_dimensions() |
45 * |
46 * |
46 * @param int $width Current width of the image |
47 * @param int $width Current width of the image |
47 * @param int $height Current height of the image |
48 * @param int $height Current height of the image |
48 * @param int $wmax Maximum wanted width |
49 * @param int $wmax Maximum wanted width |
49 * @param int $hmax Maximum wanted height |
50 * @param int $hmax Maximum wanted height |
50 * @return mixed Array(height,width) of shrunk dimensions. |
51 * @return array Shrunk dimensions (width, height). |
51 */ |
52 */ |
52 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { |
53 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { |
53 _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' ); |
54 _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' ); |
54 return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); |
55 return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); |
|
56 } |
|
57 |
|
58 /** |
|
59 * Calculated the new dimensions for a downsampled image. |
|
60 * |
|
61 * @since 2.0.0 |
|
62 * @deprecated 3.5.0 |
|
63 * @deprecated Use wp_constrain_dimensions() |
|
64 * @see wp_constrain_dimensions() |
|
65 * |
|
66 * @param int $width Current width of the image |
|
67 * @param int $height Current height of the image |
|
68 * @return array Shrunk dimensions (width, height). |
|
69 */ |
|
70 function get_udims( $width, $height ) { |
|
71 _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' ); |
|
72 return wp_constrain_dimensions( $width, $height, 128, 96 ); |
55 } |
73 } |
56 |
74 |
57 /** |
75 /** |
58 * {@internal Missing Short Description}} |
76 * {@internal Missing Short Description}} |
59 * |
77 * |
247 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) { |
265 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) { |
248 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' ); |
266 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' ); |
249 |
267 |
250 global $wpdb; |
268 global $wpdb; |
251 |
269 |
252 $user = new WP_User( $user_id ); |
270 if ( ! $user = get_userdata( $user_id ) ) |
|
271 return array(); |
253 $post_type_obj = get_post_type_object($post_type); |
272 $post_type_obj = get_post_type_object($post_type); |
254 |
273 |
255 if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) { |
274 if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) { |
256 if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros ) |
275 if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros ) |
257 return array($user->ID); |
276 return array($user->ID); |
937 function current_theme_info() { |
956 function current_theme_info() { |
938 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' ); |
957 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' ); |
939 |
958 |
940 return wp_get_theme(); |
959 return wp_get_theme(); |
941 } |
960 } |
|
961 |
|
962 /** |
|
963 * This was once used to display an 'Insert into Post' button. Now it is deprecated and stubbed. |
|
964 * |
|
965 * @deprecated 3.5.0 |
|
966 */ |
|
967 function _insert_into_post_button( $type ) { |
|
968 _deprecated_function( __FUNCTION__, '3.5' ); |
|
969 } |
|
970 |
|
971 /** |
|
972 * This was once used to display a media button. Now it is deprecated and stubbed. |
|
973 * |
|
974 * @deprecated 3.5.0 |
|
975 */ |
|
976 function _media_button($title, $icon, $type, $id) { |
|
977 _deprecated_function( __FUNCTION__, '3.5' ); |
|
978 } |
|
979 |
|
980 /** |
|
981 * Get an existing post and format it for editing. |
|
982 * |
|
983 * @since 2.0.0 |
|
984 * @deprecated 3.5.0 |
|
985 * |
|
986 * @param int $id |
|
987 * @return object |
|
988 */ |
|
989 function get_post_to_edit( $id ) { |
|
990 _deprecated_function( __FUNCTION__, '3.5', 'get_post()' ); |
|
991 |
|
992 return get_post( $id, OBJECT, 'edit' ); |
|
993 } |
|
994 |
|
995 /** |
|
996 * Get the default page information to use. |
|
997 * |
|
998 * @since 2.5.0 |
|
999 * @deprecated 3.5.0 |
|
1000 * @deprecated Use get_default_post_to_edit() |
|
1001 * |
|
1002 * @return WP_Post Post object containing all the default post data as attributes |
|
1003 */ |
|
1004 function get_default_page_to_edit() { |
|
1005 _deprecated_function( __FUNCTION__, '3.5', "get_default_post_to_edit( 'page' )" ); |
|
1006 |
|
1007 $page = get_default_post_to_edit(); |
|
1008 $page->post_type = 'page'; |
|
1009 return $page; |
|
1010 } |
|
1011 |
|
1012 /** |
|
1013 * This was once used to create a thumbnail from an Image given a maximum side size. |
|
1014 * |
|
1015 * @since 1.2.0 |
|
1016 * @deprecated 3.5.0 |
|
1017 * @deprecated Use image_resize() |
|
1018 * @see image_resize() |
|
1019 * |
|
1020 * @param mixed $file Filename of the original image, Or attachment id. |
|
1021 * @param int $max_side Maximum length of a single side for the thumbnail. |
|
1022 * @param mixed $deprecated Never used. |
|
1023 * @return string Thumbnail path on success, Error string on failure. |
|
1024 */ |
|
1025 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { |
|
1026 _deprecated_function( __FUNCTION__, '3.5', 'image_resize' ); |
|
1027 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); |
|
1028 } |