Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello Anchen,
I don't see the widget Posts of Beaver builder support showing the custom fields in the list of posts. You can get in touch with Beaver support and ask for more information.
Or use the View to create the archive template with post content and custom fields, following the documentation https://docs.metabox.io/tutorials/display-most-viewed-posts-mb-views/Peter
ModeratorHello,
You can use the code to make the field in the relationship box mandatory. Here is an example:
function your_prefix_function_name() { MB_Relationships_API::register( [ 'id' => 'post-to-product', 'from' => [ 'object_type' => 'post', 'post_type' => 'post', 'field' => [ 'required' => true //here ], ], 'to' => [ 'object_type' => 'post', 'post_type' => 'product', 'field' => [ 'required' => true //here ], ], ] ); }Following the documentation https://docs.metabox.io/extensions/mb-relationships/#using-code
October 8, 2024 at 11:13 PM in reply to: after_save_post on settings page - values not updated #46629Peter
ModeratorHello,
It isn't an issue with the action hook
rwmb_after_save_post. The issue lies in the functionupdate_post_meta()in the callback that you are using. The settings page doesn't have an object ID, so apparently, the functionupdate_post_meta()won't work to update a post meta for a post.Peter
ModeratorHello,
I test to use both Meta Box and Pods on a local site and don't see any issues. However, I'm not sure of all effects when using both plugins. I recommend migrating the Pods data to Meta Box and managing all data with Meta Box.
If you have an issue when migrating the relationships, please let me know.October 6, 2024 at 10:20 PM in reply to: after_save_post on settings page - values not updated #46615Peter
ModeratorHello,
Obviously, the settings page isn't a post, so the function
update_post_meta()doesn't work to update the settings page. You can use the functionrwmb_set_meta()orupdate_option()to update fields on a settings page.Please follow the documentation
https://docs.metabox.io/functions/rwmb-set-meta/
https://developer.wordpress.org/reference/functions/update_option/
https://docs.metabox.io/extensions/mb-settings-page/October 6, 2024 at 10:14 PM in reply to: Custom Sanitization CB for Cloneable Group but only targeting a few fields #46614Peter
ModeratorYes, if you want to apply a function to some specific fields, using the field prefix is a better way to do so.
October 6, 2024 at 10:11 PM in reply to: ✅WYISWG editor do not work inside nested group on some instances #46613Peter
ModeratorHello,
I've escalated this issue to the development team for fixing. It will be included in the next update of our plugin.
Thank you.
Peter
ModeratorHello,
Supporting the custom code is beyond our scope, please read more about support policy here https://support.metabox.io/topic/support-policy/
If you are not able to complete the task, we offer a customization service, please contact us by submitting this form https://metabox.io/contact/
for more details.October 3, 2024 at 11:02 PM in reply to: Custom Sanitization CB for Cloneable Group but only targeting a few fields #46602Peter
ModeratorHello,
1. If you use the builder, there isn't an option to apply the validation globally. I suggest you use the filter
rwmb_normalize_fieldto add a setting to all fields.
https://docs.metabox.io/filters/rwmb-normalize-field/2. You can use the function
rwmb_get_field_settings()to get all settings of the group field.
https://docs.metabox.io/functions/rwmb-get-field-settings/3. Similar to #1, you can add a specific prefix to the field ID (like abcd_fieldID) and check this (abcd) to add a setting to those fields. It would require some custom code to do so.
October 3, 2024 at 10:16 PM in reply to: ✅WYISWG editor do not work inside nested group on some instances #46601Peter
ModeratorHello Peter,
Please enable cloneable for the WYSIWYG field and enable the option "Clone empty start" then check the issue again. Let me know how it goes.
Peter
ModeratorHello Jordan,
MB Custom Post Types plugin helps you to create the CPT with UI and standard features of WordPress (https://developer.wordpress.org/reference/functions/register_post_type/), it doesn't support an option to have a dynamic slug for CPT and taxonomy.
You need to create some custom code to rewrite the CPT slug dynamically. Here are some examples:
https://stackoverflow.com/questions/51217355/custom-permalink-with-dynamic-rewrite-tags-on-a-wordpress-custom-post-type
https://stackoverflow.com/questions/59482836/create-a-dynamic-rewrite-rule-for-custom-taxonomyPeter
ModeratorHello,
Now I see the archive page /property/ doesn't exist, screenshot https://imgur.com/JRYL43E
Can you please recheck this?
October 2, 2024 at 9:50 PM in reply to: Custom Sanitization CB for Cloneable Group but only targeting a few fields #46593Peter
ModeratorHello Dave,
Let me answer your questions.
1. You can follow this topic to understand how to use sanitize for cloneable group
https://support.metabox.io/topic/custom-sanitization-cloneable-group-php-error/#post-395082, 5. No, by default, subfields in a group field are not sanitized. It is noted in the documentation
https://docs.metabox.io/sanitization/#default-sanitize-callbacks3. No, the field ID in a group field is mandatory to sanitize the value.
4. No. If you want to validate a field without reloading the page, please use the Validation feature
https://docs.metabox.io/validation/Peter
ModeratorHello,
The WordPress function get_terms() returns an array of terms. So you need to use a loop to output the term in the array. Here is an example:
{% set cats = mb.get_terms({ 'taxonomy': 'topic', 'hide_empty': false }) %} {% for cat in cats %} {{ cat.name }} <br> {% endfor %}You can read more about how to use PHP functions in the View template: https://docs.metabox.io/extensions/mb-views/#running-php-functions
Peter
ModeratorHello Lloyd,
Please try to deactivate all plugins except Meta Box, MB AIO and create the CPT again. Let me know how it goes.
-
AuthorPosts