Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,711 through 1,725 (of 3,702 total)
  • Author
    Posts
  • in reply to: Display CPT in page #11656
    Anh TranAnh Tran
    Keymaster

    For better organization, I put each module in separate files which are located in different folder.

    This is great and is a recommended way to organizing fields. I also wrote about this.

    Problem is value in fields cannot be retrieved, all none whilst html output is OK.

    Can you provide more details on how you retrieve values? Code is appreciated.

    in reply to: Datetime validation #11655
    Anh TranAnh Tran
    Keymaster

    Hi,

    The datetime fields doesn't do validation for the format. It's kind of a bug in jQueryUI datepicker. I'd suggest setting the field readonly to prevent users entering values in wrong format.

    Anh TranAnh Tran
    Keymaster

    Hi Purdue,

    I've just pushed an update for both MB Revision and MB Custom Table. Now they work well together and you can use them to track revisions for CPT in custom tables. Please update and let me know if you find any problem.

    in reply to: Display CPT in page #11642
    Anh TranAnh Tran
    Keymaster

    Have you resolved this? Do you need any further help?

    in reply to: Data are not saved into the database. #11639
    Anh TranAnh Tran
    Keymaster

    Hi,

    When I unserialize the value, I see questions and answers are saved correctly:

    https://www.unserialize.com/s/54991f6e-ab47-be68-7bdc-00006081513b

    FYI, the group extension saves all sub-field values in a serialized array in the database (which is what you just saw). When you get the value, it will be unserialized and returns an array.

    in reply to: Cannot add Custom Post Type #11638
    Anh TranAnh Tran
    Keymaster

    Hi Cornwall,

    The MB Custom Post Type plugin creates only custom post types. No meta boxes or custom fields are created with it. To create meta boxes or custom fields, you'll need MB Builder.

    in reply to: Display CPT in page #11637
    Anh TranAnh Tran
    Keymaster

    I see, it's much clearer now.

    To get the field values from your table CPT, please pass the post ID (value of the field pricing_table_id) to the 3rd parameter of rwmb_meta function. Here is a modified version of your initial code:

    $table = isset( $pricing['pricing_table_id'] ) ? $pricing['pricing_table_id'] : '';
    if ( $table ) {
      $plans = rwmb_meta( 'plan', '', $table ); // THIS
      if ( ! empty( $plans ) ) {
        foreach ($plans as $plan) {
          $name = isset( $plan['plan_name'] ) ? $plan['plan_name'] : '';
          echo $name;
        }
      }
    }
    in reply to: Display CPT in page #11629
    Anh TranAnh Tran
    Keymaster

    Hi Huy,

    To the the current post object, please use:

    $post = get_post();

    To get fields, just use rwmb_meta(). But I think you already know that.

    I'm not sure what your problem is. Can you provide more details and the setup code of meta box, so I can give more useful instruction?

    in reply to: MB Settings extension #11625
    Anh TranAnh Tran
    Keymaster

    Hi Dan,

    Unfortunately, creating setting page requires coding. It's just 10 lines of code and you can go to Appearance > Editors to add them into your theme's functions.php file.

    Then you can use the MB Builder to create fields for settings page using GUI and finally use BB Themer to get the settings and show them on the front end.

    in reply to: MB Settings extension #11621
    Anh TranAnh Tran
    Keymaster

    Hi,

    To create a settings page, there are 2 steps:

    • Creating a settings page first, using the filter mb_settings_pages, and
    • Creating fields for the settings page, using the normal mb_meta_boxes.

    Both steps are described in this documentation. Please take a look and let me know if you see any difficulty.

    in reply to: Default empty w/required fields #11618
    Anh TranAnh Tran
    Keymaster

    Hi,

    I think if you mark a field required, the browser will force you to enter a value. It works per field, which means it doesn't depend on values of other fields. So no matter that field is in a group or not, if it's required, it should have a value.

    I'd suggest using custom JavaScript code to check the emptiness of a group (clone) before submitting the post, and not using the required featured. This way, you control when and how the field is "required".

    in reply to: OpenStreetMap is not working properly with Tabs Extension #11617
    Anh TranAnh Tran
    Keymaster

    Hi Saqib,

    Thanks for your feedback. I've just fixed in MB Tabs extension and in Meta Box plugin. Please update MB Tabs and get the dev version of Meta Box on Github. I'll release new version for Meta Box soon.

    Thanks

    in reply to: WYSIWYG Field not swapping between editor modes #11615
    Anh TranAnh Tran
    Keymaster

    Thanks for the info. I'm checking your site and found a problem: the ID of the field contains a space:

    https://imgur.elightup.com/sFnaTYm.png

    That comes from the $prefix = strtolower($this->attributes['post']['single']);, which transform Case Study to just case study. It should be case_study. Please try this code:

    $prefix = str_replace(' ', '_', strtolower($this->attributes['post']['single']));

    The space in field ID (and then in the input name/ID) causes unexpected behavior, and that might be a cause to this problem.

    in reply to: Display CPT in page #11604
    Anh TranAnh Tran
    Keymaster

    Hi Huy,

    Do you mean getting the post object or getting the items in the pricing table?

    Can you also share the code of the meta box?

    Anh TranAnh Tran
    Keymaster

    Hi Purdue,

    There's a bug that MB Revision doesn't work with custom table yet. We're working on that. Please wait for a few days.

Viewing 15 posts - 1,711 through 1,725 (of 3,702 total)