After doing tests and working with a friend I was able to find a solution:
Just change how the function get_full_url grabs the url:
// Go to 'protected function get_full_url()'
// Line 200 (approx. if you've made the same changes stated above) in UploadHandler.php
// change this line, should be the last one in the function
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], "https://wordpress.stackexchange.com/"));
// After editing this is what you should end with
substr($_SERVER['DOCUMENT_ROOT'],0, strrpos($_SERVER['DOCUMENT_ROOT'], "https://wordpress.stackexchange.com/"));
This is what worked for me (along with the customized code from the question), allowing me to use the demo uploader in a custom WordPress page. Creating a frontend upload form! Hope this helps someone.
Related Posts:
- How can I add an image upload field directly to a custom write panel?
- Checking if a file is already in the Media Library
- Standard location for plugin to save/cache files?
- Saving data-URI to media library
- Can I use the wp media uploader for my own plugin?
- Change Media Uploader default directory
- Changing upload directory for plugin uploads only
- Upload file to remote storage
- Why are two functions over-riding each other?
- WordPress Media mime type filter problem 4.0
- Using the component outside the editor. select(‘core’) is null
- Proper way to hook wp_get_attachment_url
- Getting Details Of Uploaded Image
- Sharing a common set of image files for media library, across all sites within multisite
- Hook to get image filename when it is uploaded
- How to send email in wordpress with more than one attachments
- Using the default wordpress uploader inside plugin
- Files automatically added
- What filter should I use to insert a button inside on Media>Add New
- Changing upload dir in a plugin regardless of post type
- How to replicate Media Library “Add New” on Plugin Settings Page
- Plugin writing: access file that was just uploaded
- Custom delete option button in plugin settings
- How to enable sorting in custom media uploader in plugin
- Create a new post using rest api and save featured image using an external image url
- Why is the temporary upload always 4.1K
- Upload multiple images and insert them into custom html code
- wp_editor add media button not working
- WordPress Specified file failed upload test
- How to create a digital product download link that can’t be used twice?
- How to submit/upload data to database and in specific folder?
- Cleaning a filename after image sideloading a url that contains `%20`
- Get audio metadata on file upload
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Why doesn’t update_post_meta work for certain strings?
- wp.media Uncaught TypeError: Cannot read properties of undefined (reading ‘state’)
- Insert and read media from the WordPress library and call in the plugin
- Trying to rename a file upload as the hash of file content on wordpress
- Home page is not loading, where in other pages are displaying on the site
- WordPress5.2.3: Better File Download Plugin validation issue
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- Changed media upload path for plugin, but generates error & shows wrong url
- How to destroy or dispose wordpress uploder/manager?
- Displaying $_FILES data (simlar to $_POST)
- Changing upload directory for plugin uploads only
- How do you filter get_media_items by mime type in a custom media upload tab?
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- upload script in plugin development [duplicate]
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Upload to a specific media folder created by FileBird Lite
- Load images from CDN and custom features to “Add Media” dialogue
- upload image to wordpress media library failed for custom post type
- wp media uploader and ID3 tags
- WordPress Playground and uploading permission issue
- Do uploaded files to /tmp/ get deleted in WordPress automatically?
- How to modify the uploads directory for wp.media.frame assigning an subfolder name
- WordPress Media Uploader not displaying image that has just been uploaded
- How to override existing plugin action with new action
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- Where to enqueue stylesheets for plugin?
- How can the tinyMCE dom be manipulated (offical API does not seem to work)?
- stray elements
- Deletion of shared options using uninstall.php
- Plugin Settings not Saving on Ajax re-ordered table
- Undefined function wp_set_password
- How to modify the new WordPress 4.5 link inline toolbar
- Prevent plugin from deleting important directories
- When I deactive WooCommerce Plugin, I want to take a action in My plugin
- Executing a function upon webhook calling wordpress
- How to display additional info in the plugins admin table?
- How a deprecated function can crash WordPress site while upgrading
- What is the proper method of using global $post?
- how to add stylesheet to particular plugin only?
- Difference between wp_salt schemes
- WordPress debug messages not displaying
- Show message from backend
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Woocommerce inventory [closed]
- how to load the comment template from a plugin
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- How can I prevent ‘500 internal server error’ because of a long install process?
- Displaying custom content from a plugin within the active theme
- Downloading File via headers doesnt work
- How to copy the all WordPress media items to another custom plugin folder?
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- pull data from wordpress database
- Object Oriented plugin, add action and variables
- Tracing dashboard publish settings from input form in WordPress
- Virtual Page with Registration form
- Images not displaying on live server
- redirect word-press page with page values
- Forcing the Uninstall Hook to fail
- How to display .ptm file in my WP site without JAVA
- Getting similar posts by custom field value
- Does WP REST API cache internally executed (rest_do_request) requests?
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- ‘useSate’ error when using React on the frontend in custom block plugin