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
- dbDelta not creating tables
- How to implement color picker from wordpress in my plugin?
- Nonces can be reused multiple times? Bug / Security issue?
- How to Add a .js file Only in one specific Page Dynamically to Head
- Displaying search results in the widget itself?
- Missing “category_children” option when dynamically creating categories via a plugin
- Looking for callback function after Gutenberg is rendered?
- How to duplicate a curl XML request using HTTP API?
- How to avoid loading same script twice?
- Is there any way to check for user login and send him to login?
- Can I individually style items in the backend widget list?
- Why is my javascript not invoked in my hooks except wp_head?
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- Issue regarding $wpdb->prepare()
- Checkbox Undefined index error in Plugin
- Change the look and feel of admin pages
- how to search users by ajax live search
- Generate JSON files for language translation from po file without wp-cli i18n make-json
- Display WordPress the_content() via data attributes
- Constraints in custom tables for plugin development – Yes or No?
- Run Shortcode of post’s custom field in functions.php / Plugin
- load_plugin_textdomain doestn’t work with add_action plugins_loaded
- wp_get_post_terms Order by not working
- Naming conventions when using (PHP5) namespaces?
- Readme.txt seems to be cached but not the version
- change add to cart button link [closed]
- Encoding Method for URLs?
- Store custom meta box data as serialized array
- AJAX request not routing through proxy
- Why won’t this submenu page show? – My First WordPress Plugin
- Multiple dynamic Tax Query – pass taxonomy argument from array
- ACF Field value in wordpress login message filter
- ajax stopped working when not logged in wordpress
- Overriding the template files using a plugin for all themes
- Determine if the current page, is being edited
- List Table action argument not cleared
- Fullwidth slider using background image Flexslider WordPress
- Return value of $wpdb->update() query in plugin is wrong
- Plugin files not updated (cache cleared)
- How to limit the number of posts a user can view based on status
- WordPress permalink setting
- WordPress plugin tables become corrupt
- How to call a new php page inside a plugin page?
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Is the only way to add taxonomy terms via an admin panel?
- WP Job Manager – Show recent jobs as cards
- Admin Menu for New Post