WordPress FrontEnd Media Upload

I’m trying to use Media Library in frontend
Here is the code I’m using to create wp-editor :

wp_enqueue_media();
wp_editor( '', 'custom_editor_id' );
_WP_Editors::enqueue_scripts();
print_footer_scripts();
_WP_Editors::editor_js();

But the problem is that when I click on button Add Media, I receive:

Read More
Uncaught TypeError: Cannot read property 'replace' of undefined

I’ve done a lot of research today, and didn’t found a solution. Could you show me the way to do that?

Best Regards,
Mateusz

Related posts

Leave a Reply