Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Johann,
Working with Backbone (which is used to make everything with the media library) in WordPress is a pain. There's no documentation at all in the Codex. There are very few articles about it ๐
You can read the source code of Meta Box to understand how to word with
wp.media.view. This is another great tutorial to start working with Backbone view.However, in the WordPress environment, there's no official solution to inject fields into the Media Details Popup for now. This is how we use
wp.mediato open the Media details popup when clicking the edit link. The technique is discovered by funkedgeek on Github.I see Jetpack adds some config for Tiled Gallery in the Media popup, which might be a good example how to hack it.
June 8, 2016 at 11:34 AM in reply to: Post metabox with select advanced - big amount of related posts #3394Anh Tran
KeymasterLooks like the problem with the select2 library. Do you see the problem if you load fewer entries (500 for example) and no limit on the displayed result? I tried searching and found only this result but it's not 100% the same issue.
Anh Tran
KeymasterThis is done as a standalone plugin here https://github.com/rilwis/mb-rest-api. Will be soon available on WordPress.org.
Anh Tran
KeymasterHi, the
sizesvalue returned is not thesizesattribute in responsive image. It's an array of the following info:[sizes] => Array ( [thumbnail] => Array ( [file] => press_image-150x150.jpg [width] => 150 [height] => 150 [mime-type] => image/jpeg ) [medium] => Array ( [file] => press_image-4-300x194.jpg [width] => 300 [height] => 194 [mime-type] => image/jpeg ) [large] => Array ( [file] => press_image-1024x665.jpg [width] => 1024 [height] => 665 [mime-type] => image/jpeg ) [post-thumbnail] => Array ( [file] => press_image-624x405.jpg [width] => 624 [height] => 405 [mime-type] => image/jpeg ) )To get the
sizesattribute, we can use the following function:wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 )So, in your code, you can do like this:
foreach ( $images as $image ) { $sizes = wp_calculate_image_sizes( array( $image['width'], $image['height'] ), null, null, $image['ID'] ); echo "\n<a href='{$image['full_url']}'>\n<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' srcset='{$image['srcset']}' sizes='{$sizes}'>\n</a>"; }June 6, 2016 at 8:31 AM in reply to: Group and file_upload (AND clone) : only 1st file_upload is considered #3344Anh Tran
KeymasterHi, I see you closed this issue on Github. So I will close this thread now. We'll track the issue with iPad on Github ๐
Anh Tran
KeymasterHi @jonwatson87,
I'm very happy to see you figured it out. The way you use the helper function is correct!
Anh Tran
KeymasterThat's a myth of the HTML 5
numberfield :). You can do that simply by using'step' => 'any'!Anh Tran
KeymasterHi @Maxell, can you please clarify the idea? I'm not sure what you're talking about.
Anh Tran
KeymasterCan you post the code of the
search.phppage? I think it's best to don't userwmb_metaon thesearch.phpat all.Anh Tran
KeymasterHi @sociality,
Thanks for your feedback. I've just found the problem with Group's JavaScript and made a fix for it here http://pastebin.com/YhzB331K.
Can you please download this and replace the
group.jsfile in the Group extension? I will update the extension if the patch works.Thanks a lot.
Anh Tran
KeymasterYes, that's right. The "std" value is not copied to cloned fields, neither. I think you shouldn't rely on it for cloned fields.
Anh Tran
KeymasterGlad that you have resolved this ๐
Anh Tran
KeymasterHi @carassius,
We've just added a filter
rwmb_option_labelfor this purpose. Please try the development version on Github. Thanks.Anh Tran
KeymasterHi @weseo, sorry for the delay. Now it's safe to include all extensions into themes/plugins. Please follow this instruction:
1. Copy extension folder to your theme
2. Open "functions.php" and add the "include" line to the extension main fileThat's all. Enjoy ๐
Anh Tran
KeymasterNew version has just been released with this improvement. Please update it ๐
-
AuthorPosts