Forum Replies Created
-
AuthorPosts
-
April 1, 2021 at 9:04 AM in reply to: ✅Import .csv to create WP posts: how to populate address field with geolocation? #26852
Long Nguyen
ModeratorHi,
Thank you for reaching out.
I'm afraid that it is not possible. We have to some actions like click, typing (keyup) to trigger the searching function.
I will inform the development team to explore the possibility of this case.
Long Nguyen
ModeratorHi,
Thank you for your feedback.
I've escalated this issue to the development team. It will be fixed in the next update as soon as possible.
Long Nguyen
ModeratorHi webdev,
Do you mean the field type
group?
https://metabox.io/plugins/meta-box-group/The data will be lost because the field ID is store in the database as a meta key. When you create a new field in a
groupfield, the meta key is group ID so you have to add the field value again.March 31, 2021 at 12:11 PM in reply to: ✅Meta Box custom fields not available in wpDataTables #26828Long Nguyen
ModeratorHi Harness,
Thank you for using our plugin.
It looks like the plugin wpDataTables search in the database, table
wp_postmetafor the meta key (field ID) to create a table/chart. There is no data in the tablewp_postmetawhen you just create meta boxes and custom fields, please try to add field value to some posts then update the post and re-check it.March 30, 2021 at 9:05 PM in reply to: ✅Displaying 2 custom post types via a relationship custom post type #26821Long Nguyen
ModeratorHi Henri,
I've dived into this case and found a way to achieve this goal. We can use a query nested in the main query to get the connected post A > B > C as your expectation.
I've created a post type
bookand have two relationships. Here is the code:add_action( 'mb_relationships_init', function() { MB_Relationships_API::register( [ 'id' => 'posts_to_pages', 'from' => 'post', 'to' => 'page', ] ); } ); add_action( 'mb_relationships_init', function() { MB_Relationships_API::register( [ 'id' => 'posts_to_books', 'from' => 'post', 'to' => 'book', ] ); } );When displaying a page, I can show posts related to this page and books related to those posts
$connected_post = new WP_Query( [ 'relationship' => [ 'id' => 'posts_to_pages', 'to' => get_the_ID(), // You can pass object ID or full object ], 'nopaging' => true, ] ); while ( $connected_post->have_posts() ) : $connected_post->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php $connected_book = new WP_Query( [ 'relationship' => [ 'id' => 'posts_to_books', 'from' => $connected_post->post->ID, // You can pass object ID or full object ], 'nopaging' => true, ] ); while ( $connected_book->have_posts() ) : $connected_book->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php endwhile; $connected_book->reset_postdata(); ?> <br> <?php endwhile; wp_reset_postdata();Let me know if it helped.
Long Nguyen
ModeratorHi,
I can create a new one as well, screenshots
https://share.getcloudapp.com/bLuADm76
https://share.getcloudapp.com/xQubpWKlLong Nguyen
ModeratorHi,
For some flexible cases, I think you can try to use the extension MB Conditional Logic. Example, you can show/hide a field base on a checkbox.
https://docs.metabox.io/extensions/meta-box-conditional-logic/Long Nguyen
ModeratorHi,
After looking around on Google, I see the reCaptcha is still created here https://www.google.com/recaptcha/admin/create#list.
Please try to create a new one while the development team is working to integrate the reCaptcha Enterprise.
Long Nguyen
ModeratorHi Davide,
Thank you for reaching out.
The
groupfield does not support adding the settingreadonly. This setting only applies to some simple fields liketext,url,email,checkbox,radio,date,time,datetimewhich are sub-fields inside the group.March 30, 2021 at 10:09 AM in reply to: ✅Settings page "switch" field - hopefully quick question #26808Long Nguyen
ModeratorHi,
Here is an example:
- The code which I use to create a settings page and a meta box with a switch field
- The code which I use to create a custom function and hook to the action
rwmb_{$meta_box_id}_after_save_post, the function will be fired after you click Save Settings on the settings page.
add_filter( 'mb_settings_pages', 'custom_settings_page' ); function custom_settings_page( $settings_pages ) { $settings_pages[] = [ 'menu_title' => __( 'Options', 'project-name' ), 'option_name' => 'my_options', 'id' => 'my_options', 'position' => 25, 'columns' => 1, 'icon_url' => 'dashicons-admin-generic', ]; return $settings_pages; } add_filter( 'rwmb_meta_boxes', 'custom_sitewide_fields_group' ); function custom_sitewide_fields_group( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'My Meta Box', 'project-name' ), 'id' => 'my-meta-box', 'settings_pages' => 'my_options', 'fields' => [ [ 'id' => 'enable_slider', 'name' => 'Enable Slider?', 'type' => 'switch', 'style' => 'rounded', 'on_label' => 'Yes', 'off_label' => 'No', ], ], ]; return $meta_boxes; }See more on docs https://docs.metabox.io/extensions/mb-settings-page/
https://docs.metabox.io/fields/switch/add_action( 'rwmb_my-meta-box_after_save_post', function() { $enable_slider = rwmb_meta( 'enable_slider', ['object_type' => 'setting'], 'my_options' ); if( $enable_slider ) { // function goes here echo "Enabled"; } else { // function goes here echo "Disabled"; } } );Hope that makes sense.
Long Nguyen
ModeratorHi NorCal,
Thank you for reaching out.
Please follow the step Debugging Information here https://support.metabox.io/topic/how-to-create-a-new-topic/.
Then share some screenshots and error logs, I will help you to investigate the issue.
March 29, 2021 at 8:53 PM in reply to: ✅How to import costom post types from other tool (CPT UI) #26800Long Nguyen
ModeratorHi friends,
Thank you for reaching out.
A simple way to use Meta Box to control a custom post type which is created by CPT UI is
- deactivate the plugin CPT UI
- create a new post type with MB Custom Post Type with the same slugGet more details on this article https://metabox.io/move-custom-post-type-custom-field-data-from-pods-to-meta-box/.
March 29, 2021 at 2:29 PM in reply to: ✅Settings page "switch" field - hopefully quick question #26794Long Nguyen
ModeratorHi Kevin,
Thank you for reaching out.
You can hook a function to the action
rwmb_{$meta_box_id}_after_save_postwith the latest meta box register on the settings page. After saving the value of this meta box, the custom function will be fired.Get more details in the documentation
https://docs.metabox.io/actions/#rwmb_after_save_post
https://docs.metabox.io/extensions/mb-settings-page/#getting-field-valueLong Nguyen
ModeratorHi Sara,
Thank you for contacting us.
For example, you can wrap the field value in a
<a>tag and a<button>tag to make the button clickable.<a href="<?php echo rwmb_meta( 'field_URL_id' ); ?>"> <button>Click me!</button> </a>Please follow this documentation to know how to output the field value https://docs.metabox.io/displaying-fields/.
Long Nguyen
ModeratorHi,
Thank you for reaching out and feedback.
The extension MB Custom Post Type does not cover two points that you mention. I'm going to inform the development team to consider adding it to the roadmap for developing this extension.
-
AuthorPosts