Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello,
The array and object in Twig are different a bit from PHP. You can change the code to this one:
{% set date_query = { relation: 'OR', 0: { key: 'departure_date', value: 'now'|date("Y-m-d"), compare: '<', type: 'DATE' }, 1: { key: 'departure_date', compare: 'NOT EXISTS', type: 'DATE' } } %}Peter
ModeratorHello,
If you add something to the default form, you should create some custom CSS code to style that element. I think it is expected.
If you don't know how to create CSS code, please contact us here https://metabox.io/contact/
our development team will help you with a small fee.Peter
ModeratorHello Yasmine,
You can define an array of custom fields that is not changed across field groups (reusable), then use the function
array_merge()to add more fields to the reusable field group to other field groups for your requirements. For example:add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { // Reusing field group 1 $field_group_1 = [ [ 'name' => __( 'Datetime', 'your-text-domain' ), 'id' => 'datetime_jeq28wycry', 'type' => 'datetime', ] ]; $additional_fields = [ [ 'name' => __( 'Custom Html', 'your-text-domain' ), 'type' => 'custom_html', ], ]; $field_group_2 = array_merge( $field_group_1, $additional_fields ); $meta_boxes[] = [ 'title' => __( 'Field Group 1', 'your-text-domain' ), 'id' => 'field-group-1', 'post_types' => 'page', 'fields' => $field_group_1, ]; $meta_boxes[] = [ 'title' => __( 'Field Group 2', 'your-text-domain' ), 'id' => 'field-group-2', 'post_types' => 'page', 'fields' => $field_group_2, ]; return $meta_boxes; }Peter
ModeratorHello,
There is a parameter
rwmb_frontend_field_post_idin the URL when you edit a post. Then you can use the code below to check if it is a new post submitted (not an edited post):add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) { if( empty( $_GET['rwmb_frontend_field_post_id'] ) ) { // your code to send email goes here } }, 20, 2 );Peter
ModeratorHello Mark,
Please contact us here https://metabox.io/contact/
the development team will help you to fix the issue with the license key.October 21, 2023 at 11:36 AM in reply to: Subscriber User Role cannot upload images to their User profile on the frontend #43574Peter
ModeratorHello,
The problem here is the field single_image supports uploading images via the WordPress media library popup and WordPress does not allow subscriber user role to upload images. You can read more here https://wordpress.org/support/topic/subscriber-role-cannot-upload-media-file/
So in this case, you can use the field type
imageorimage_uploadwhich supports uploading images and it doesn't open the Media Library popup.Peter
ModeratorHello Lisa,
Do you use the images from Media Library instead of Meta Box custom field? Let me know how it goes.
Peter
ModeratorHello Stephen,
You should use the "Reciprocal" option when creating a relationship between one post type, for example: post-to-post, page-to-page. It will prevent two relationship meta boxes when editing a post.
using a product_faq custom field: it looks like you are using a post custom field. The relationship has a separate meta box with a select field when editing the post (Product or FAQ). If it does not work as expected, can you please share some screenshots of the relationship on your site?Read more in the documentation https://docs.metabox.io/extensions/mb-relationships/#using-meta-box-builder
Peter
ModeratorHello,
curently editors can create new setting pagesI do not see that on my demo site. Only the administrator can access the Meta Box builder (mb post types) to create a settings page. Do you use a custom code or a third-party plugin that changes the capabilities of the editor role?
Peter
ModeratorHello there,
You can try to switch to tab Text and use this sample code to add the helper shortcode to the
<a>tag.test <a href="[rwmb_meta id='url_field']">content</a>Remember to replace the double quotes with single quote in the shortcode.
October 17, 2023 at 11:13 PM in reply to: frontend form for relationships acting differently on different pages #43548Peter
ModeratorHello,
Do you use the field type
selectwhen registering the relationship between "bookings" & "enquiries"? Please share the code that you use to register the relationship, I will help you to check the issue.Peter
ModeratorHello,
For the HTML5 attribute, you can use the attribute
pattern. For the advanced validation, you can use the remote validation. Then add your own regex to validate the input value.Following the documentation
https://docs.metabox.io/validation/
https://www.w3schools.com/tags/att_input_pattern.aspPeter
ModeratorHello,
You can use the settings
minTimeandmaxTimeto set the selectable time range. Please follow the documentation
https://trentrichardson.com/examples/timepicker/#tp-options
https://docs.metabox.io/fields/datetime/#settingsPeter
ModeratorHello Elene,
You can try to follow this tutorial to increase the PHP setting
max_input_varsto fix the issue
https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/Let me know how it goes.
Peter
ModeratorHello Lisa,
I have received a report from a user that relates to the Elementor Loop feature. If you use the carousel image in a loop widget, it only displays the first image even with a list image manually selected from WordPress (not using Meta Box field). Can you please confirm this on your site?
-
AuthorPosts