image_resize
(deprecated) is returning an error object so really, the problem is here: $new_img_path = image_resize( $file_path, $width, $height, $crop );
Something is wrong with that line and you are not checking whether the return value is an error object or a string before trying to use the return value as a string.
You did not post any code that might help me work out what is wrong with $new_img_path = image_resize( $file_path, $width, $height, $crop );
but at the very least you should do:
$new_img_path = image_resize( $file_path, $width, $height, $crop );
if( !is_wp_error()) {
$new_img_size = getimagesize( $new_img_path );
// ...
Converting to use WP_Image_Editor
would be wiser though.
Related Posts:
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- Is there an equivalent to WP_Error object I can return in the case of a successful REST request?
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- How can I send an email using PHP?
- Should I use spl_autoload_register() in my plugin?
- List of all theme customizer control types?
- Shortcode putting html such as
- Load post content into iframe
- Editor role cannot save custom theme options
- Installing wp3.2.1 on IIS; getting empty sessions
- WordPress widget in custom theme
- Specific Loop For 2 Within Each
- POSTS list in WordPress by views
- How do I enable HTML5 prefetching on this page?
- Anything I can add to functions.php to make text widgets accept PHP?
- What’s the proper way to use wp_enqueue_script/style?
- user_id error: Only variables should be passed by reference
- How to find the output of contact form 7 shortcode? [closed]
- Print number of post (in reverse)
- Is it necessary to upgrade to php7? [closed]
- Can’t increase posts_per_page by variable
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- How to check If Oembed is empty or not
- How do I access the media settings
- How can I output a php value into a JS file within WordPress?
- Set post title based on first h2 element in the content section
- Custom field value not saving when it contains a URL?
- WordPress to end support for PHP 4?
- Why does WordPress remove my variables in the URL?
- get current custom post ID by WP_Query method
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Mute Debug Messages from Plugins
- Reprinting tags with all attributes
- Set WP_query ‘order’ option by another tables value
- database sent to a JSON file
- Settings API callback function inserts html quotes from nowhere
- Show when user is online/offline in real time on user_profile.php
- can i fetch a custom metabox data in another page or post type?
- Call to undefined function get_userdata() in plugin
- How to add different text in each result of foreach?
- how to update and display an option without reloading the page
- Add item to top of menu using a filter in functions.php
- How to include seperate PHP file to class in callback function
- ‘Post-thumbnails’ feature does not seem to register
- multiple where condition in result query
- How to use html inside a functions.php code?
- Nested “do” and “add” Actions is possible?
- Deprecated: Function create_function() is deprecated [closed]
- displaying content that includes shortcodes within an echo
- Trying to prepend a Hashtag symbol to the_tags links [closed]
- How do I define a lookup table that will work across all PHP elements of the template?
- trouble with page_id & highlighting current page
- How to use two meta_compare in an array?
- How to hook a logout funtion for specific usr role in wordpress?
- Custom post type category not displaying category ID
- Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta)
- create front-end users post list by specific category
- How to get the filename from file system and create a download link?
- PHP getting error when trying to access WP-Admin Dashboard
- Foreach implode issue
- Error display post thumbnails for previous and next post
- Conditional for Post Format
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Dynamically added custom fields not displayed on WooCommerce email notifications
- End of blog roll or start of blog roll, _post_link = false / no link
- How to Remove Theme Style CSS inside Custom Plugin?
- get different meta-data of a complicated query at the same time
- Please help! I have a problem with getting wordpress databas
- Get only relevant sub-category of category “Genre” that applies to current product only
- How to escape echo for input tag?
- 400 bad request admin-ajax file upload
- Custom Loop.php having a loop inside a loop
- Add Shortcode to ::before class
- Warning: count(): syntax problem of the count () function
- Reload page with a different shortcode when a user selects from a dropdown
- How to display custom seo title before the loop?
- WooCommerce get products based on the taxonomy
- Woocommerce Add custom “Add to cart button” in single page with tags
- Displaying child taxonomy before parent
- Add div after every 4 posts then every 2 posts for a responsive loop
- Update same content in multiple posts at once?
- Different home page for logged off users
- Widget Update problems using a for loop
- What to create new post using wp_insert_post, but it repeat the post infinitely
- Non-static method error when trying to use class in widgets
- Send data from plugin to external database
- Get terms of the posts with one query
- Changes in header.php not reflecting
- WP Admin Bar – Get current theme name as custom menu title
- Newly published content gives 404 on wordpress
- Show custom default avatar instead of gravatar
- the_post_thumbnail unless video id is added
- Get unique post in parent category
- ajax form function error
- Advanced Custom Fields Show PHP in Text Areas
- New to WordPress & Freelancing [closed]
- Add a “Next Post” & “Previous Post” styled button manually to a post
- How to store the_post_thumbnail() value in a variable
- how to display tables via ajax