Forum Replies Created
-
AuthorPosts
-
April 8, 2020 at 5:32 PM in reply to: ✅Is Meta Box (with premium extensions) Too Advanced For Me? #18923
Long Nguyen
ModeratorHi Elizabeth,
Thank you for spending your time to use the plugin Meta Box and Extensions.
This plugin has been developed over 8 years ago, it has a lot of functions (APIs) to help the user creates the meta boxes and fields. It supports a little UI to create the Post types, Taxonomies and Custom fields if you do not want to touch the code but if you want to get more options/customizations, you have to know a bit of code to use the API.
After activating the plugin MB AIO, you can check the available extensions in Admin Dashboard -> Meta Box -> Extensions and almost of it does not have the UI, just manipulate by the code.
Regarding the registration form, it is the prebuilt form with the shortcode to show on the front and we can change the fields with shortcode parameters. And you can use the CSS code to style the elements inside the form as well.
Thank for your understanding and let me know if you have any questions.
April 8, 2020 at 5:20 PM in reply to: ✅MB_Relationships_API::each_connected Returns Empty Array #18922Long Nguyen
ModeratorHi,
Thank you for pointing out this bug. We have released a new update to fix it as well, please update the extension MB Relationships or MB AIO plugin then check the function
each_connected()again.Long Nguyen
ModeratorHi Benj,
The extension MB Frontend Submission only helps the visitor/user can submit the post with the prebuilt shortcode to show the form.
If you want to create your own form and pull the value from the field, please try to use the function
rwmb_the_value()orrwmb_get_value()or the shortcode.Long Nguyen
ModeratorHi Benj,
Thank you, it is a bug. I also log this case and send to the developer team.
Long Nguyen
ModeratorHi Benj,
The form validation works as well without the option Ajax submit
[mb_frontend_form id='meta-box-id' post_fields='title,content']You can check the option
requiredin MB builder or use the validation to validate the form input.After changing something in the Builder or the code that creates the fields, you should refresh the post/page and click Update again to apply the changes.
Long Nguyen
ModeratorHi guys,
You are right, there is a problem with the validation when the form uses Ajax to submit. I've talked with the developer team to fix this bug and it will be wrapped in the next update as soon as possible.
Thanks for your patience.
Long Nguyen
ModeratorHi,
It is impossible but when outputting the field value, you can check the user role before with simple code
if( check_user_role() ) { echo rwmb_meta('field_id'); }please following this guide to know the function to check user role.
Long Nguyen
ModeratorHi,
The Meta Box plugin only helps you to create the fields, save the input and display the output easier. If you want to resize/optimize the image automatically, please follow this article to get a plugin to achieve the goal.
Long Nguyen
ModeratorHi James,
The page builder only shows the custom fields when you create the fields and assign them to the post. You can use the MB Builder or Online Generator tool to grab all the fields into a meta box with a few clicks.
For more information, please follow the documentation.
Long Nguyen
ModeratorHi Benj,
The field
imagelets the user upload images without accessing the Media Library of WordPress, please follow this documentation.Long Nguyen
ModeratorHi Matt,
You can create a relationship between terms easy with this code
add_action( 'mb_relationships_init', function () { MB_Relationships_API::register( [ 'id' => 'term_to_term', 'from' => [ 'object_type' => 'term', 'taxonomy' => 'category', ], 'to' => [ 'object_type' => 'term', 'taxonomy' => 'product_cat', ], ] ); } );an example between the category of post and product category of Product (WooCommerce). Then this code will show the terms which are related
$args = array( 'taxonomy' => 'product_cat', 'relationship' => [ 'id' => 'term_to_term', 'from' => get_queried_object_id(), // You can pass object ID or full object ], ); $terms = get_terms( $args ); foreach ( $terms as $term ) { echo $term->name . '<br>'; }To manipulate with the terms, please follow this documentation.
Long Nguyen
ModeratorOr simply you can use a piece of Javascript code to show/hide the button. Here is an example HTML code to show the radio
<input type="radio" id="internal" name="check" value="internal" checked> <label for="internal">internal</label><br> <input type="radio" id="external" name="check" value="external"> <label for="external">external</label><br>and you can use this code with Code Snippets plugin to do this trick
add_action( 'wp_footer', function() { ?> <script type="text/javascript"> jQuery(document).ready(function($) { $("input[name='check']"). click(function(){ var radioValue = $("input[name='check']:checked").val(); if(radioValue == 'internal'){ $('.wp-block-button').show(); } else { $('.wp-block-button').hide(); } }); }); </script> <?php } );a short screen record for this action https://cl.ly/2263ff2a45dc
Long Nguyen
ModeratorHi Brian,
The extension MB Conditional Logic helps you to show/hide the field or other HTML elements on the backend. This guide maybe help you to create a conditional logic when showing the elements on the frontend.
Long Nguyen
ModeratorHi,
Let's see the simple custom field for the post
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); function your_prefix_register_meta_boxes( $meta_boxes ) { $prefix = 'your_prefix_'; // check your prefix here $meta_boxes[] = array ( 'title' => esc_html__( 'Text', 'text-domain' ), 'id' => 'text', 'post_types' => array( 0 => 'post', ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array ( 'id' => $prefix . 'text_field', 'type' => 'text', 'name' => esc_html__( 'Text Field', 'text-domain' ), ), ), ); return $meta_boxes; }after connect to show the Meta Box Field, you can check the conditional logic with the field id
your_prefix_text_field. I've created a screen record for this case https://cl.ly/1210e564df6fLong Nguyen
ModeratorHi,
The right ID of the field is
$prefix . 'field_id', could you please check the$prefixvariable above the code if it has any string? Or share the code that you use to create the field. -
AuthorPosts