Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 3,661 through 3,675 (of 3,702 total)
  • Author
    Posts
  • in reply to: Include Group plug-in in theme files with Roots #577
    Anh TranAnh Tran
    Keymaster

    Oh, I see. The problem is you missed the fields parameter for group field. You have to do like this:

    'fields' => array(
        array(
            'id' => 'group',
            'type' => 'group',
            'fields' => array( // you missed this parameter for group
                array(...),
                array(...),
            ),
        ),
    ),
    in reply to: Change order #575
    Anh TranAnh Tran
    Keymaster

    Cool, glad it helps ๐Ÿ™‚

    I'd think about order to records fields. Thanks for your idea!

    in reply to: Change order #572
    Anh TranAnh Tran
    Keymaster

    Are you using get_post_custom to get post meta? Because from what you said, it looks like you display fields in the backend in one order and display fields in the frontend in another order, and as we don't have a function to list all fields in the frontend, the only way to do that I guess is get_post_custom function.

    If so, I'm afraid there's no way to achieve that. The order you register fields = the order fields are displayed in the backend = the order WP processes data and stores in the DB = the order you get with get_post_custom.

    Or maybe you should do something like array_reverse as a trick before displaying fields in the frontend?

    in reply to: Include Group plug-in in theme files with Roots #570
    Anh TranAnh Tran
    Keymaster

    Hi,

    I see that the problem is you use the old way to integrate theme with Meta Box plugin. It's not recommended anymore as it broke as you saw.

    To eliminate this problem, please

    - Remove the first block of code to include Meta Box
    - Install Meta Box from wp.org as a normal plugin
    - Install MB Group extension
    - Register meta boxes according to this documentation (I don't see your full code so I'm not sure you're using rwmb_meta_boxes filter, if yes - then it's perfect, you don't need to change anything, but if no, please update the code).

    I wrote another documentation explaining why we should use plugin instead of included it directly in themes. Please take a look.

    Best regards

    in reply to: Change order #569
    Anh TranAnh Tran
    Keymaster

    All you need to do is moving the array of the latest field to the first place in the fields array, something like in this screenshot:

    in reply to: Change order #567
    Anh TranAnh Tran
    Keymaster

    Hi, as we're using code to register meta boxes and fields, the only way with coding to change fields' order is changing code. There's no easier way to do that :(.

    Best regards.

    in reply to: How to make MB Group work with better-include.php #566
    Anh TranAnh Tran
    Keymaster

    The example is well-written in the extension documentation. All you need is just add include or exclude parameter to meta box definition, no need to add custom function for checking like better-include demo.

    in reply to: How to make MB Group work with better-include.php #558
    Anh TranAnh Tran
    Keymaster

    Unfortunately the better-include.php method uses old way to register meta boxes (via admin_init hook). This way still works, but you can not use it with rwmb_meta_boxes filter, e.g. if you register meta boxes with rwmb_meta_boxes filter, you can't use better-include.php method.

    I'd suggest you use only global $meta_boxes variable to register meta boxes, and remove code to register meta boxes via rwmb_meta_boxes filter.

    A better solution is using MB Include Exclude extension, which is tested with Group extension.

    in reply to: How to make MB Group work with better-include.php #545
    Anh TranAnh Tran
    Keymaster

    No problem, it's quite straight forward. Try this code:

    https://gist.github.com/rilwis/423be7e4c38d14c09642

    in reply to: Migrating data to a group, formatting breaking #544
    Anh TranAnh Tran
    Keymaster

    Glad to hear that the data migration works well. It'd be a pain if we loose data.

    I tried again with your code and I see that the last field doesn't have enough columns (8 while it should be 12 to fill in the row). It's a note that each row must have enough 12 columns, here you have first row with 2+10 columns, 2nd row with 4+4+4 columns and 3rd row has only 8 columns.

    I tried changing 8 to 12 and it works fine to me:

    in reply to: How to display fields on WP post-frontend ? #541
    Anh TranAnh Tran
    Keymaster

    Hi eisenrith,

    The MB Builder plugin helps you to create meta boxes and custom fields for posts in the back-end faster than traditional way (traditional way is registering via PHP code as described in this docs and this docs).

    This extension doesn't mean to show meta values in the frontend. To do that, you need to use a helper PHP function rwmb_meta() to retrieve meta value and display it. Please follow this detailed instruction and if you need any help, please let me know.

    Thanks

    in reply to: Migrating data to a group, formatting breaking #538
    Anh TranAnh Tran
    Keymaster

    Hi,

    I've tested with your data and here is my result:

    1. I use the following code to add data to a post:

    https://gist.github.com/rilwis/452dec0295484a455875#file-add-data-php

    2. Then I register a meta box with following code:

    https://gist.github.com/rilwis/452dec0295484a455875#file-register-meta-boxes-php

    And here is final result:

    http://prntscr.com/6cxqpm

    I think it works for me. Can you check the code to import data and register meta box again? If you need any help, please let me know.

    in reply to: Migrating data to a group, formatting breaking #530
    Anh TranAnh Tran
    Keymaster

    So it's solved now?

    If you need me for anything, please let me know.

    in reply to: Cloned Group not saving on Update #526
    Anh TranAnh Tran
    Keymaster

    Hi Andy,

    I've just checked your code and it works for me: http://prntscr.com/6cft18

    Can you please check again?

    in reply to: How to make MB Group work with better-include.php #525
    Anh TranAnh Tran
    Keymaster

    I think there is a misunderstanding here:

    - The Group extension is just one kind of field (special one), it acts exactly like other field type like text, file, etc.
    - The techniques to show/hide meta boxes are applied for meta boxes only, not for fields, so they're not applied to groups.

    But you can do a tricky way like this to achieve what you want:

    - Create a meta box
    - In that meta box, define only 1 group and put all fields under this group
    - Use techniques above to hide whole meta box

    Because this meta box contains only 1 group, show/hide this meta box actually show/hide this group.

    Hope that helps. If you need anything, please let me know.

    Thanks

Viewing 15 posts - 3,661 through 3,675 (of 3,702 total)