Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 3,196 through 3,210 (of 3,702 total)
  • Author
    Posts
  • in reply to: Post Meta fields in Media Details Popup #3395
    Anh TranAnh Tran
    Keymaster

    Hi 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.media to 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.

    Anh TranAnh Tran
    Keymaster

    Looks 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.

    in reply to: WP REST API #3379
    Anh TranAnh Tran
    Keymaster

    This is done as a standalone plugin here https://github.com/rilwis/mb-rest-api. Will be soon available on WordPress.org.

    in reply to: Responsive Images #3378
    Anh TranAnh Tran
    Keymaster

    Hi, the sizes value returned is not the sizes attribute 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 sizes attribute, 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>";
    }
    Anh TranAnh Tran
    Keymaster

    Hi, I see you closed this issue on Github. So I will close this thread now. We'll track the issue with iPad on Github ๐Ÿ™‚

    in reply to: Returning CPT meta array, if not empty #3303
    Anh TranAnh Tran
    Keymaster

    Hi @jonwatson87,

    I'm very happy to see you figured it out. The way you use the helper function is correct!

    in reply to: Save Decimal into Number field #3281
    Anh TranAnh Tran
    Keymaster

    That's a myth of the HTML 5 number field :). You can do that simply by using 'step' => 'any'!

    in reply to: โœ…Can we use it within Menus ? #3276
    Anh TranAnh Tran
    Keymaster

    Hi @Maxell, can you please clarify the idea? I'm not sure what you're talking about.

    in reply to: Meta Boxes - Disable in Search #3275
    Anh TranAnh Tran
    Keymaster

    Can you post the code of the search.php page? I think it's best to don't use rwmb_meta on the search.php at all.

    in reply to: Issue upon Saving Group Values in the BackEnd #3267
    Anh TranAnh Tran
    Keymaster

    Hi @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.js file in the Group extension? I will update the extension if the patch works.

    Thanks a lot.

    in reply to: std attribut Default Values to be MULTIPLE #3266
    Anh TranAnh Tran
    Keymaster

    Yes, that's right. The "std" value is not copied to cloned fields, neither. I think you shouldn't rely on it for cloned fields.

    in reply to: Can't save groups anymore #3262
    Anh TranAnh Tran
    Keymaster

    Glad that you have resolved this ๐Ÿ™‚

    in reply to: โœ…Groups within Tabs #3251
    Anh TranAnh Tran
    Keymaster

    Hi @carassius,

    We've just added a filter rwmb_option_label for this purpose. Please try the development version on Github. Thanks.

    in reply to: Metabox as Library #3250
    Anh TranAnh Tran
    Keymaster

    Hi @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 file

    That's all. Enjoy ๐Ÿ™‚

    in reply to: Columns style sheet not loaded correctly #3249
    Anh TranAnh Tran
    Keymaster

    New version has just been released with this improvement. Please update it ๐Ÿ™‚

Viewing 15 posts - 3,196 through 3,210 (of 3,702 total)