Title: FYI developers: A deprecated WP function found in code.
Last modified: September 1, 2016

---

# FYI developers: A deprecated WP function found in code.

 *  [dfaltermier](https://wordpress.org/support/users/dfaltermier/)
 * (@dfaltermier)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/fyi-developers-a-deprecated-wp-function-found-in-code/)
 * Michael, Ben, Jamie, other dev folks.
 * I noticed the following plugin file includes a deprecated WordPress function:
   image_resize().
    See: [https://developer.wordpress.org/reference/functions/image_resize/](https://developer.wordpress.org/reference/functions/image_resize/).
 * File: taxonomy-images.php
    Line: 172
 * This might be what you want as the replacement code:
 *     ```
       <br />
       $image_editor = wp_get_image_editor( $path );</p>
       <p>if ( ! is_wp_error( $image_editor ) ) {</p>
       <p>    // Create a new downsized version of the original image.<br />
           $image_editor->resize(<br />
               $detail['size'][0], // width<br />
               $detail['size'][1], // height<br />
               $detail['size'][2]  // crop (e.g. true)<br />
           );<br />
           // Modify the filename to include the image size suffix and save.<br />
           $new_path = $image_editor->generate_filename( null, $path );<br />
           $image_editor->save( $new_path );</p>
       <p>    // Generate and cache image metadata. Return url.<br />
           $meta = wp_generate_attachment_metadata( $id, $path );<br />
           wp_update_attachment_metadata( $id, $meta );<br />
           $image_intermediate_attrs = image_get_intermediate_size(<br />
               $id,<br />
               $detail['name']<br />
           );</p>
       <p>    if ( isset( $image_intermediate_attrs['url'] ) ) {<br />
               return $image_intermediate_attrs['url'];<br />
           }<br />
       }<br />
       ```
   
 * If I got this right, I hope this is helpful.
    David
 * [https://wordpress.org/plugins/taxonomy-images/](https://wordpress.org/plugins/taxonomy-images/)

The topic ‘FYI developers: A deprecated WP function found in code.’ is closed to
new replies.

 * ![](https://ps.w.org/taxonomy-images/assets/icon-256x256.png?rev=1283547)
 * [Taxonomy Images](https://wordpress.org/plugins/taxonomy-images/)
 * [Support Threads](https://wordpress.org/support/plugin/taxonomy-images/)
 * [Active Topics](https://wordpress.org/support/plugin/taxonomy-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/taxonomy-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/taxonomy-images/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)

 * 0 replies
 * 1 participant
 * Last reply from: [dfaltermier](https://wordpress.org/support/users/dfaltermier/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/fyi-developers-a-deprecated-wp-function-found-in-code/)
 * Status: not resolved