Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi,
If you want to add an array in the builder, please follow this documentation https://docs.metabox.io/extensions/meta-box-builder/#dot-notation
June 15, 2022 at 11:10 AM in reply to: can't retrieve settings page, group field single image data/value/image url #36494Long Nguyen
ModeratorHi,
To get the field value from the settings page, you can use this sample code
$value = rwmb_meta( $field_id, ['object_type' => 'setting'], $option_name ); echo $value;To get a single image from the group, you can use this sample code
$group = rwmb_meta( 'group_id' ); $image_id = $group['image_key']; $image = RWMB_Image_Field::file_info( $image_id, ['size' => 'thumbnail'] ); echo '<img src="' . $image['url'] . '">';In your case, the code would be
$group = rwmb_meta( 'home_page_top_ad_group', ['object_type' => 'setting'], 'ev_advertisements' ); $image_id = $group['home_page_top_ad']; $image = RWMB_Image_Field::file_info( $image_id, ['size' => 'thumbnail'] ); echo '<img src="' . $image['url'] . '">';Read more on the documentation
https://docs.metabox.io/extensions/mb-settings-page/#getting-field-value
https://docs.metabox.io/extensions/meta-box-group/#sub-field-valuesLong Nguyen
ModeratorHi,
Thank you for your feedback.
This issue has been fixed in a new commit. It will be included in the next update of this plugin.
Long Nguyen
ModeratorHi,
To order by title, please just use this code
orderby: 'title'
Refer to this topic https://support.metabox.io/topic/how-to-order-sort-related-posts-by-title-or-custom-field-value/
and this documentation https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parametersLong Nguyen
ModeratorHi,
The object type should be
post,term,userandrecipeshould be assigned to thepost_typesettingMB_Relationships_API::register( array( 'id' => 'recipes_to_products', 'from' => [ 'object_type' => 'post', 'post_type' => 'recipe', ], 'to' => 'product', ) );Long Nguyen
ModeratorHi Dan,
If you use the field
single_image, then you can remove theforloop and access the image ID directly from the group value. Like this<?php $group = rwmb_meta( 'car' ); $image_id = $group['my_image']; $image = RWMB_Image_Field::file_info( $image_id, ['size' => 'thumbnail'] ); echo '<img src="' . $image['url'] . '">'; ?>June 15, 2022 at 8:14 AM in reply to: [bug] InnerBlocks breaks Flex, how to apply this fix in MB Blocks? #36488Long Nguyen
ModeratorHi,
Thank you for your feedback.
This issue has been added to our backlog development. The fix for this will be included in future updates.
Long Nguyen
ModeratorHi,
The link with instruction is applied to the taxonomy field in the backend. Please try to use this one
function your_prefix_function_name( $meta_boxes ) { $meta_boxes[] = [ 'title' => __( 'My Meta Box', 'your-text-domain' ), 'id' => 'my-meta-box', 'fields' => [ [ 'name' => __( 'Taxonomy', 'your-text-domain' ), 'id' => 'taxonomy_ipppnv41eid', 'type' => 'taxonomy', 'taxonomy' => ['category'], 'field_type' => 'select_advanced', 'query_args' => [ 'exclude' => 86, // here or use array of term IDs [86, 87, 88] ], ], ], ]; return $meta_boxes; }Long Nguyen
ModeratorHi Ole,
It is possible to add a custom field to the login form. But there is no function to process/validate the field value in the form. I will inform the development team to explore the possibility.
June 14, 2022 at 12:14 PM in reply to: Displaying a custom field in the list of comments in the backend using MB Admin #36472Long Nguyen
ModeratorHi Max,
Currently, the plugin MB Admin Columns does not support adding columns in the comment table (admin area). I will inform the development team to consider supporting it in future updates.
Long Nguyen
ModeratorHi,
Most scripts (CSS, JS) in a theme or a plugin are registered by the function wp_enqueue_script() and they are loaded in the header or footer of the page. So if you remove the header or footer, the script files could not be loaded.
I think you can try to use the CSS code to hide the header and footer instead of excluding them from loading.Long Nguyen
ModeratorHi,
Can you please share the code that you are using on your site? Some screenshots or a screen record would be highly appreciated.
June 14, 2022 at 6:34 AM in reply to: How to order/sort related posts by title or custom field value? #36469Long Nguyen
ModeratorHi Brent,
Basic knowledge about WordPress query and PHP code is needed to create the template in MB Views. Following your previous topic, you can create the custom query with the
orderargument like this<h2> Presenters </h2> {% set args = { post_type: 'presenters', nopaging: true, order: 'DESC', orderby: 'title', relationship: { id: 'events_presenters_relationship', from: post.ID } } %} {% set presenters = mb.get_posts( args ) %} ...Read more on the documentation https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
https://docs.metabox.io/extensions/mb-views/#custom-queryLong Nguyen
ModeratorHi,
To output the subfield image in a group, please try to use this example code
$group = rwmb_meta( 'group_id' ); $image_ids = $group['image_key'] ?? : []; foreach ( $image_ids as $image_id ) { $image = RWMB_Image_Field::file_info( $image_id, ['size' => 'thumbnail'] ); echo '<img src="' . $image['url'] . '">'; }It is already added to the documentation https://docs.metabox.io/extensions/meta-box-group/#sub-field-values
June 13, 2022 at 11:41 PM in reply to: Basic Bundle - Constructive criticism on Getting-started instructions #36462Long Nguyen
ModeratorHi Andrew,
Thank you for your feedback.
I will discuss with our team to improve the documentation for the new users to get started quickly and easier.
-
AuthorPosts