Forum Replies Created
-
AuthorPosts
-
June 1, 2021 at 10:29 PM in reply to: ✅Cannot access values and labels in a checkbox field loop #28595
Long Nguyen
ModeratorHi Jon,
kobis an array of checkbox list values, you can echo item in the loop to show each value{% for item in kob %} {{ item }} <br> {% endfor %}to show the checkbox list labels, just use the function rwmb_the_value() outside the loop
{{ mb.rwmb_the_value( 'kind_of_business', '', post.ID, false ) }}Regarding the custom query, I've updated the documentation here
https://docs.metabox.io/extensions/mb-views/#custom-query
https://docs.metabox.io/extensions/mb-views/#main-queryLong Nguyen
ModeratorHi,
I got the issue. The function
is_singular( 'event' )still check if the template available on the theme templates, please remove this code.if ( isset( $_GET['ics'] ) ) { ...}and remove unnecessary code
include get_stylesheet_directory() . '/inc/ICS.php';wrap your field ID in the single quote
$start_date = rwmb_get_value( 'ci_event_start_date', array( 'format' => 'Y-m-d g:iA' ) ); $end_date = rwmb_get_value( 'ci_event_end_date', array( 'format' => 'Y-m-d g:iA' ) );Let me know how it goes.
Long Nguyen
ModeratorHi,
As on this post, you can access the properties of the post object when using a custom query.
<p>{{ post.post_title }}</p>Long Nguyen
ModeratorHi Sherwin,
Thanks for your effort and sharing your knowledge.
You can follow this documentation to bypass the default sanitization https://docs.metabox.io/sanitization/#bypass-the-sanitization
June 1, 2021 at 9:29 AM in reply to: Only show parent taxonomies in Advanced Taxonomies field #28581Long Nguyen
ModeratorHi,
Thank you for your feedback.
I will inform the development team to fix this issue in the next update. For now, you can use the code to get the parent taxonomy https://docs.metabox.io/fields/taxonomy-advanced/
June 1, 2021 at 6:27 AM in reply to: ✅MetaBox.io on WordPress Dashboard's WordPress Events and News #28580Long Nguyen
ModeratorHi,
You can use this code to remove the WordPress Events and News widget
add_action( 'wp_dashboard_setup', function() { remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); } );and this code to remove Meta Box menu from dashboard menus
add_action( 'admin_init', 'remove_menu_metabox' ); function remove_menu_metabox() { if ( !current_user_can( 'administrator' ) ) { //change role or capability here remove_menu_page( 'meta-box' ); } }Refer to these articles
https://metabox.io/remove-unwanted-meta-boxes-wordpress/
https://support.metabox.io/topic/hiding-meta-box-plugin-from-wordpress-dashboard-menu-for-non-admins/Long Nguyen
ModeratorLong Nguyen
ModeratorHi Jorge,
If you set the view render for the post content area in the Archive page, the view content will replace each post content in the list posts. Please refer to this topic https://support.metabox.io/topic/tag-archive-my-view-gets-ignored-when-rendering-only-the-post-content-area/
Long Nguyen
ModeratorHi Ferol,
The plugin WP All Import might help you on this case, refer to this documentation https://www.wpallimport.com/documentation/advanced-custom-fields/repeater-fields/
Or you can try to use this couple of plugins
https://wordpress.org/plugins/wp-ultimate-csv-importer/
https://wordpress.org/plugins/wp-ultimate-exporter/Long Nguyen
ModeratorHi,
- When clicking the Add to Calendar button, there is a popup box to download the file .ics so the firewall might block this behavior. You can contact their support to get more information.
-
Change the curry quote to the single quote on this code
if ( is_singular( ‘event’ ) && isset( $_GET['ics'] ) ) {to
if ( is_singular( 'event' ) && isset( $_GET['ics'] ) ) {And the important point in step 2 of the article is to use a theme template. If not, this function get_stylesheet_directory() will not work.
You can copy content of the file ICS.php and add before the function
justread_ics_download()class ICS { ... } function justread_ics_download() { ... }The shortcode should include all PHP and HTML form, please don't break it into two parts.
add_shortcode( 'calendardata', function() { $start_date = rwmb_get_value( ci_event_start_date, array( 'format' => 'Y-m-d g:iA' ) ); $start_date = wp_date( 'Ymd\THis', $start_date ); $end_date = rwmb_get_value( ci_event_end_date, array( 'format' => 'Y-m-d g:iA' ) ); $end_date = wp_date( 'Ymd\THis', $end_date ); ?> <form method="post" action="?ics=true"> <input type="hidden" name="start_date" value="<?php echo $start_date; ?>"> <input type="hidden" name="end_date" value="<?php echo $end_date; ?>"> <input type="hidden" name="location" value="<?php echo rwmb_meta( 'event_location' ); ?>"> <input type="hidden" name="summary" value="<?php the_title(); ?>"> <input type="submit" value="Add to Calendar"> </form> <?php } );May 31, 2021 at 9:41 PM in reply to: ✅Cannot access values and labels in a checkbox field loop #28567Long Nguyen
ModeratorHi Jon,
Please follow this topic to know how to get custom field value in a custom query https://support.metabox.io/topic/mb-view-by-shortcode/
Retrieve checkbox list value will get an array so you need to use a loop to show all value.
https://docs.metabox.io/fields/checkbox-list/If you want to get the label, please follow on this topic https://support.metabox.io/topic/label-not-rendered/
Long Nguyen
ModeratorHi Greg,
It might relate to this topic https://support.metabox.io/topic/select-choices-callback-cache/
I recommend creating the block with code instead of Builder to show the dynamic data.
Long Nguyen
ModeratorHi Greg,
Thank you for getting in touch.
Please follow this topic https://support.metabox.io/topic/not-show-taxonomy-field-values-in-mb-blocks/
and let me know if it helped.Long Nguyen
ModeratorHi Greg,
Thank you for your feedback.
I've escalated this case to the development team to cover it in the next update.
Long Nguyen
ModeratorHi,
Custom fields created by Meta Box have the default sanitize callbacks, you can read more here https://docs.metabox.io/sanitization/.
And sanitization use for input data, for output data, you should use the escaping output. Follow on WordPress documentation https://developer.wordpress.org/themes/theme-security/data-sanitization-escaping/
-
AuthorPosts