Forum Replies Created
-
AuthorPosts
-
August 13, 2021 at 9:22 PM in reply to: ✅Only showing certain custom fields on the frontend submission? #30233
Long Nguyen
ModeratorHi John,
Yes, if the meta box is not loaded on the frontend, the post submitted wouldn't save the field value. There is some form hooks that let you update the field value after submitting posts, please find it here https://docs.metabox.io/extensions/mb-frontend-submission/#form-actions
Long Nguyen
ModeratorHi,
It is the page that has the frontend submit shortcode
[mb_frontend_form], screenshot https://share.getcloudapp.com/Z4ujz0E8Long Nguyen
ModeratorHi,
It's based on the settings of your theme. Meta Box does not handle the displaying of the archive page title.
August 13, 2021 at 10:48 AM in reply to: ✅Use Checkbox Custom Type and When Checked Show Icon on Frontend #30207Long Nguyen
ModeratorHi,
You can add the code to the post template file of the theme.
single.phpis a good started file to understand how Meta Box output the field value. Or you can contact your theme support to ask for adding the code to the template files.Long Nguyen
ModeratorHi,
The extension MB Frontend Submission does not support adding more frontend submit and frontend dashboard shortcodes on a page. The functions of the plugin might not work properly. You need to add each shortcode on a page separately.
Long Nguyen
ModeratorHi,
Thanks for the additional information.
So you can use the action
rwmb_{$field_id}_after_save_fieldto update the field value after submitting/updating a post. Refer to this topic
https://support.metabox.io/topic/using-custom-meta-fields-to-create-cpt-title/And documentations
https://docs.metabox.io/actions/#rwmb_after_save_field
https://docs.metabox.io/rwmb-set-meta/August 12, 2021 at 2:13 PM in reply to: ✅Use Checkbox Custom Type and When Checked Show Icon on Frontend #30189Long Nguyen
ModeratorHi,
You need to add the code to your theme's post template file. Please read more on the documentation https://docs.metabox.io/displaying-fields/#using-code
Long Nguyen
ModeratorHi,
This issue has been fixed. We've also created a note when creating a new CPT and select Capability Type: Custom
If select custom capability, make sure to add capabilities to admin or other roles to add or edit posts of this type (using a plugin like Members or User Role Editor).Long Nguyen
ModeratorHi,
Thank you for getting in touch.
Currently, the extension only supports to create a single relation as the documentation. Thanks for the idea, I will inform the development team to explore the possibility.
August 12, 2021 at 11:20 AM in reply to: ✅Use shortcode to display custom taxonomy metadata with taxonomy #30182Long Nguyen
ModeratorHi Darren,
If you set the group cloneable, it will return an array of clone values so you need to create a loop to iterate through items. For example:
$groups = rwmb_meta( 'awards_info' ); if ( empty( $groups ) ) { return ''; } $output = ''; foreach ( $groups as $group ) { // Sub-field year. $year = $group['year'] ?? ''; ... }Please read more here https://docs.metabox.io/cloning-fields/
And the
taxonomy_advancedfield also returns an array of term IDs when retrieving the value, so you need a second loop to get the term ID. For example:$term_ids = $group['award']; foreach ( $term_ids as $term_id ) { $term = get_term( $term_id ); $output .= '<h3 class="award">' . $term->name . '</h3>'; }Please read more here https://docs.metabox.io/fields/taxonomy-advanced/#template-usage
https://docs.metabox.io/extensions/meta-box-group/#sub-field-valuesThe whole shortcode should be
add_shortcode( 'awards', function() { $groups = rwmb_meta( 'awards_info' ); if ( empty( $groups ) ) { return ''; } $output = ''; foreach ( $groups as $group ) { // Sub-field year. $year = $group['year'] ?? ''; $output .= '<h3 class="year">' . $year . '</h3>'; // Sub-field award. $term_ids = $group['award']; foreach ( $term_ids as $term_id ) { $term = get_term( $term_id ); $output .= '<h3 class="award">' . $term->name . '</h3>'; } // Sub-field award status. $award_status = $group['award_status'] ?? ''; $output .= '<h3 class="award_status">' . $award_status . '</h3>'; } return $output; } );Hope that makes sense.
August 12, 2021 at 9:31 AM in reply to: ✅"Insert Field" button and File Advanced inside of Loops #30175Long Nguyen
ModeratorHi Tom,
The
multiplesetting is always set totruefor this field so it will return an array when getting the field value. You need to create a loop to iterate through array elements to get each file info. For example{% set my_file = mb.rwmb_meta( 'file_advanced', '', post.ID ) %} {% for item in my_file %} {{ item.url }} <br> {% endfor %}Get more details on the documentation https://docs.metabox.io/fields/file-advanced/#template-usage
Long Nguyen
ModeratorHi John,
It looks like there is a problem with the REST API on your site. Please try to re-save the permalink settings then follow the Debugging Information step here https://support.metabox.io/topic/how-to-create-a-new-topic/ to troubleshoot the issue.
Refer to this topic https://wordpress.org/support/topic/coderest_no_routemessageno-route-was-found-matching-the-url-and-reque/
Long Nguyen
ModeratorHi Janos,
Yes, it is possible. Please follow this documentation to know how to run a PHP function in View https://docs.metabox.io/extensions/mb-views/#running-php-functions
Then you can use the WordPress function
get_terms()to list the taxonomies
https://developer.wordpress.org/reference/functions/get_terms/August 12, 2021 at 6:28 AM in reply to: ✅Only showing certain custom fields on the frontend submission? #30168Long Nguyen
ModeratorHi John,
Yes, the condition code helps you to show a/some meta boxes on the backend only and you (or someone who can access to admin area) can add the data to save them as well. You need to have a basic knowledge of coding and using the code to do more advanced cases.
Frontend submission form is generated automatically if you use the Builder, screenshot https://share.getcloudapp.com/6quY0AD5
Or created manually https://docs.metabox.io/extensions/mb-frontend-submission/
Then you can add the shortcode to the textarea/shortcode widget of the Builder.
Long Nguyen
ModeratorHi,
So I think this case is related to the topic https://support.metabox.io/topic/only-showing-certain-custom-fields-on-the-frontend-submission/
You can remove the meta box on the frontend and show it on the backend only.
-
AuthorPosts