Solution for "media-upload not working" on Post-edit page
-
I could not add media (imaged) easily to my post, by using the “Upload/Insert” “Add an image” button.
I got no popup for uploading, but a new page openend. When selecting media, filling in the required fields, and pressing “Insert into Post”, nothing happenend. Furthermore, I noticed the JavaScript error “win.send_to_editor is not a function” in the error console.
I read a lot of messages from other people complaining about the same problem.
My solution was simple, after some research:
* In the child directory of my theme (themes/twentyten-child), I had to modify the functions.php file. I added a function to it:
function enable_media_upload(){ wp_enqueue_script('media-upload'); }
and added a line to the list of add-filter and add-action items:
add_action( 'admin_menu', 'enable_media_upload' );
Thereby, when logged in as admin for adding a post, the “media-upload” javascript file was included, enabling to add media to my post. Now everything works fine.
Is it normal that this is missing? Is this the correct way to solve it? Or is this a bug of the “older” version of WP I am using, which is the Stable version in my Debian release?
- The topic ‘Solution for "media-upload not working" on Post-edit page’ is closed to new replies.