This will cause the image to be uploaded as ‘Unattached’. Hope this helps someone facing this problem in the future.
1 2 3 4 5 6 7 8 9 | event.preventDefault(); wp.media.model.settings.post.id = 0; // If the media frame already exists, reopen it. if ( file_frame ) { file_frame.open(); return; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.