Turns out I’m just silly.
WP_Error was the undefined method, not resize. I was sending a bad image location through the resize function. How silly of me! It was working all along.
I’ve included this on top
$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );
and this is my image resize function
$image = wp_get_image_editor($current);
if (!is_wp_error($image)) {
$image->resize(100, 100, false);
$image->save($target);
return "succ";
} else return "error";
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- How to add a class to the attachment images
- How to draw media details for Isotope gallery using Photoswipe
- How to register images uploaded via FTP in media library?
- Fatal error: Call to undefined function plugin_dir_path()
- Dynamic URL to reference custom PHP files
- Add custom image sizes to media uploader
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- New Plugin Review
- Change logo based on incoming domain
- Making Quote Plugin more efficient
- How to access function from outside of a class within this class in WP plugin?
- PHP can I add line numbers to file_get_contents()
- Convert all images to PNG on file upload
- How to get specific image in media library with php
- Adding Default Settings to Theme My Login plugin
- Swapping wp_dropdown_categories function with wp_category_checklist
- Set the background to a default image if there isn’t a specified “featured image”
- How to access global variable $menu inside a class function
- How can I remove a function that has been added to wordpress with add_filter?
- How to control WordPress image metadata (using Imagick)?
- what is the best practice to add new field to an api route
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- How to call plugin function per site in a multisite?
- Can’t upload image using media_sideload_image
- Scrape external webpage for first image and add it to new post
- How to make own crop image function for WordPress plugin
- WordPress Custom field Colors
- Redirect to another page using contact form 7? [closed]
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to use html inside a functions.php code?
- Plugin Generate Unexpected output during activation
- Using data sent via AJAX in multiple functions on a WP plugin
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Custom meta box values are not getting saved for my custom post type
- how to save checkbox data for custom setting?
- Else/If Statement to Display Photo Descriptions
- Call to undefined function error in plugin
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Execute Jquery when a specific page in my plugin is loading
- Adding a ‘style=’ bit to image_send_to_editor output
- Convert all uploaded PNG files to PNG-8 format
- send popup after wp_redirect()
- Using ACF Relationship field to set post type to draft or published status
- How to change basename url for wp-admin?
- Retrieve alt text by referencing the img src
- How to Send Pingbacks for all Posts in WordPress?
- Reliable way to add nonce to HTTP Header in WordPress?
- Only the first image uploads
- not outputting medium size image URL
- Add Pre-Defined Value to Click Counter in WordPress
- Illegal string offset checkbox
- How to use data URL in WordPress?
- ssl redirect function is not working
- Custom plugin: how do I call a PHP file if settings option is set to true?
- How can i avoid duplicate same post in wp?
- Display a custom name when the user has no name settle in his account
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- How to override theme’s public static function inside of a trait?
- Enqueue sripts and styles only if function is called
- post_exists stops working in a scheduled event
- Taxonomy Child Term, Counter is staying on 0
- PHP get_category() function redeclared
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Retrieving specific images from Media Library
- How do I routinely extract the thumbnail of the most recent post?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Save the outputted image into the Media Library, with a different filename and extension
- Permission error on plugin save
- Trouble using wordpress functions in a pop-up modal form
- Issues separating my Plugin pages into different files
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- display php code in header using wp_head()
- add if statement to the featured image
- How to automatically convert images to WebP on WordPress?
- Remove default Image Sizes
- How do I change the Go To Categories link in the term_updated_messages
- WP Custom tables query
- Understanding responsive imagery
- WooCommerce: write featured image dimensions to custom fields in product’
- Generate and upload screenshot as featured image for user-submitted post
- check difference between two timestamp in custom plugin
- Image alt tag is showing post title instead of Alt Text
- admin-ajax.php responding with 0
- How to scale image with equal width and height without distortion?
- Adding ads code between comments
- How to check If Oembed is empty or not
- WordPress Redirect: Default Password Reset URL [duplicate]
- Add before_content and after_content to register_sidebar
- Theme currently showing thumbnails, how to show full size?
- wrong php date()?
- Scope for PHP Variables Assigned in functions.php or a plugin
- Sort registered users by post count? (inside admin dashboard)