Comments (30)
The code for the new media uploader can be found in the /wp-admin/include/media.php file in the WordPress 3.3 beta. Been looking at it to see it can be integrated in the meta-box plugin.
from meta-box.
Is the new media uploader going to be workable once WordPress 3.3 is out?
Also work like the featured image so any images attached to a post or page can be used elsewhere also?
from meta-box.
take a look at my fork, i've created a new field type which uses the built in media uploader, and works with the new drag and drop uploader.
from meta-box.
Ooo looks good. :)
Can you add further images at the same time, like the old checkbox method of this script?
from meta-box.
I asked for more info about about plupload (the new media uploader) on Stack Exchange and the combo of EAMann and One Trick Pony came in for the win: http://wordpress.stackexchange.com/questions/33173/plupload-intergration-in-a-meta-box
One Trick Pony's answer especially gives insight to how to use plupload nicely. I added a few corrections via comment to make it truly functional
from meta-box.
Almost done with a solution. Currently got ajax uploading working. Just got get the code readable, set up some error responses in case of failure and enable a drag and drop area. I think I may get this done by the weekend.
from meta-box.
Awesome i look forward to seeing it. :)
How is the image being attached though, like with a featured image thus able to use a single image across multiple posts or how a gallery is, so only one image user per post?
The former would be amazing, but dont think its possible.
from meta-box.
New image field called plupload_image is up: https://github.com/funkedgeek/meta-box/tree/master
I wanted to ask a question to further customize this: currently, only the bottom half of the field area has the ability of having files dragged onto it. Does anyone prefer the whole area to to have this ability?
from meta-box.
It would be great if the user could select images from the media gallery too. At the moment I can only select images from the harddrive - I can remember that I could use media gallery images with WP3.2 + V3 of the meta box script.
from meta-box.
By the bottom half, do you mean the upload area itself or where the loading-images currently are? (as a php newb myself, could you also perhaps update the demo.php
?)
from meta-box.
@funkedgeek To answer your drag & drop position Q: I'd prefer to have it at the top upon the images themselves. If someone uploads a massive amount of images, the drag & drop box would go beyond the fold/visible viewport.
We will also need to
a) restrict file types,
b) restrict number of files.
Both shouldn't be js or css solutions for safety reasons. Console just gives too much freedom :)
from meta-box.
@rilwis I hope you can merge this ASAP in. I'll take a look at the code today and tomorrow and would need to have a full repo to see possible js-conflicts. Maybe we could update the readme.md for some days to state that the current version is Alpha. Thanks. :)
from meta-box.
Another Q: Should I just combine my uploader with the standard one and use an option to pic between the two?
from meta-box.
@franz-josef-kaiser I'll try my best, just too busy at the moment :(
@funkedgeek Looks like you did a great work. Yes, I guess the option to choose which uploader is good. I'm waiting for your commit :)
from meta-box.
@rilwis N/P. :)
@funkedgeek @rilwis (imho) think it's better to leave them apart. Maybe it get's harder to divide them, when we deprecate the old one - which we will. I could also imagine that people would be confused when they overread something and get the "wrong" uploader.
from meta-box.
@funkedgeek Just in case, you're currently working on this: I found a lot of bugs, copy/pasted your code and currently working on it.
from meta-box.
@funkedgeek In case you read this: Please upload the image-error.gif and image-loading.gif to your repo. Thanks :)
from meta-box.
Okay, sorry for the wait. Newly updated with the missing images. Also combined the two image uploaders. All you have to do to change it is add the uploader argument to the array with the field options. Example is in the demo file. Now that I've wrapped my head around plupload I'll be working on incorperating it into the file field as well
@franz-josef-kaiser : let me know what errors you find. I'm pretty sure I covered files being too large. File types are set in the localized object I set up for the uploader to use. I think I can set up a filter for that for the field type in general but I don't know how to do it for a particular field.
from meta-box.
@funkedgeek Oh, no :/ As I said: Currently working on this. I already added a pull request with all the fixes... Could you take a look at my last pull request and diff it with your old files? There're also some minor improvements like for the label, etc.
from meta-box.
Thanks both of you for the great works. I just accepted the pull request from @franz-josef-kaiser and will check it soon. After seeing the code, I think making it a separate field type is a good idea ;)
from meta-box.
@rilwis I'll take the images and the contents of the demo file from @funkedgeek and work it in tomorrow - hope you got time to merge it in then. We really need a) a clean state to work from and b) come up with an idea to avoid such stupid double work. So far the only idea I can think of is that I make another repo as clone from @funkedgeek, then work in all changes, make a pull request to @funkedgeek fork and then delete my new clone/fork... which is stupid... absolutely stupid. :/ I hope you guys got some better ideas.
@funkedgeek I think another filter isn't that good idea (I even added another one for the drop-message - not kool). We should really find a way to better parse in our arguments to deprecate all our actions and filters. This should be a one step process (time for another ticket).
from meta-box.
Okay, changes updated on my branch. Add some new features including an edit link
from meta-box.
@funkedgeek It's getting harder :)
Did you start working from @rilwis merge, or did you update your old pull request? I really want to avoid that we collide again and work parallel.
from meta-box.
@funkedgeek Just tried your last changes and got some errors for plupload-image.php
. You use the vars $link
and $image
on line 231. If there're no attachments so far, $wpdb->get_col()
delivers and empty array()
, so your foreach loop will work, but
$imagewill stay empty. So currently you're adding mark-up for stuff that's not there. The second problem is right after the loop, when you're adding the hidden field: You're calling
$image, which is again hidden and
$link` is again not set. Also there's no reason to add mark-up if you got nothing to display.
from meta-box.
If the array is empty it shouldn't loop by default. The rest I'll check after work.
from meta-box.
@funkedgeek With empty I meant a white space. But I was messing up line numbers. After inspecting further I fund myself beeing wrong on this. The errors came from the part after the loop. Inside the loop there's just $link
that's set nowhere.
from meta-box.
Got it fixed in the latest update
from meta-box.
Works for me. Guess we close it and move on.
from meta-box.
Same here. Thanks!
from meta-box.
Seems that the thread is long :D, and we have the working version, so I close it. You can open any issue if have any problem.
from meta-box.
Related Issues (20)
- Master branch here on GitHub is not current with version on Wordpress Repo HOT 2
- Switch labels are off HOT 2
- Usage of Select Advanced for taxonomies in admin HOT 1
- Require image orientation on image_advanced field upload HOT 1
- subtitle custom field HOT 2
- Media Library Never Loads HOT 3
- Fatal Error in Taxonomy Field on Frontend Form Following MB Update to Version 5.7.2
- Meta Box interferes with my website's Logo when activated HOT 1
- Scripts loaded on front end HOT 1
- Payment failed for Lifetime metabox.io plan
- WP's preview functionality broken by this plugin as of WP v6.4 HOT 2
- Impossible to preview posts since WP 6.4.0 HOT 1
- Code scanning security issues HOT 1
- fix: defensively check for null post in add_fields() for php 8.3 HOT 2
- Error message: Uncaught TypeError: Return value of RWMB_Sanitizer::sanitize_color() must be of the type string HOT 4
- Obtain the metadata of a MetaBox setting. HOT 4
- OT Menu Mobile not working HOT 2
- Reusing field groups
- Meta Box Custom Table - Hook for replace List_Table HOT 1
- Error saving custom patterns and template parts in WP 6.6 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meta-box.