Forum Replies Created
-
AuthorPosts
-
February 21, 2022 at 10:35 PM in reply to: Get PHP: what to do with text-domain and function name? #34042
Long Nguyen
ModeratorHi Cees,
They are the standard features of WordPress, please follow these documentations to know what is text-domain and action hooks.
Text-domain: https://developer.wordpress.org/themes/functionality/internationalization/
Action hook (a function that you want to run on that action): https://developer.wordpress.org/plugins/hooks/actions/Long Nguyen
ModeratorHi,
As the hook name
rwmb_{$meta_box_id}_after_save_post, you can use this hook to perform an extra action after saving a metabox. If you want to perform an extra action after saving a field, please use this hookrwmb_{$field_id}_after_save_field. Read more on the documentation https://docs.metabox.io/actions/#rwmb_after_save_fieldrwmb_testfield_after_save_fieldFebruary 21, 2022 at 4:16 PM in reply to: Reinitialize conditional logic javascript after page load? #34032Long Nguyen
ModeratorHi Stephen,
Please try to add this code to the file conditional-logic.js line 585
// Export the runConditionalLogic to global scope to use in other scripts. rwmb.runConditionalLogic = runConditionalLogic;before the function
setTimeout( init, 100 );, screenshot https://monosnap.com/file/rQP339lmZ4HCZg3byBWYjwRMKZ9aZMThen on your JS file, you can call it
rwmb.runConditionalLogic( $scope )where$scopeis a jQuery element. If this works, I will inform the development team to add the code in the next update.February 21, 2022 at 9:35 AM in reply to: ✅How to translate custom field labels for different admin users languages ? #34027Long Nguyen
ModeratorHi,
Exactly, each field group is a post type and the builder saves all data to the database. Then use the function to register meta boxes and custom fields based on that data. Loco might not scan the text from there. You will need to use the PHP code to register meta boxes and fields to translate by Loco Translate.
February 21, 2022 at 8:43 AM in reply to: ✅Is it possible to customize entry titles for clonable sub-group? #34026Long Nguyen
ModeratorHi,
The builder does not support fully customizing. You need to use the PHP code to register the field type
groupto use another field value in group title like this'group_title' => 'Static text {#} {sub_field_1} {sub_field_2}',Long Nguyen
ModeratorHi Mark,
The extension MB Relationships saves data in a custom table, please read more here https://docs.metabox.io/extensions/mb-relationships/#database
You can try to create the code to import data to the custom table, here are some tuts
https://code.tutsplus.com/tutorials/custom-database-tables-importing-data--wp-28869
https://wordpress.org/support/topic/import-to-custom-table/Long Nguyen
ModeratorHi,
Please tick the parent term to show child terms like my screenshot https://imgur.com/iNBMl1Z
The term meta does not relate to this case.Long Nguyen
ModeratorHi,
If you want to output the user meta in Elementor page builder, you can try to create a shortcode then add the shortcode to the builder. For example:
// Requires PHP 7+. add_shortcode( 'show_user_post_related', function() { $author_id = get_post_field( 'post_author', get_queried_object_id() ); $post_id = rwmb_meta( 'academics_university', ['object_type' => 'user'], $author_id ); if ( empty( $post_id ) ) { return ''; } $output = get_the_title( $post_id ); return $output; } ); // Usage: put [show_user_post_related] into your post content or page builder modules.Screenshot https://monosnap.com/file/VjRHbqnqdJOUcCg5DH62G7mImc9Dep
Long Nguyen
ModeratorHi,
Meta Box does not support showing a field value based on another field value on "live". You need to create some JavaScript code to use AJAX to do that, refer to this topic https://support.metabox.io/topic/dynamically-filled-select-not-saving/
February 19, 2022 at 10:35 AM in reply to: ✅Is it possible to customize entry titles for clonable sub-group? #34001Long Nguyen
ModeratorHi,
You can follow this documentation to set the title for the collapsible group https://docs.metabox.io/extensions/meta-box-group/#collapsible-groups
Long Nguyen
ModeratorHi,
The subfield
taxonomy_advancedin a group, field typecheckbox_treeworks as well on my site. Screenshot https://imgur.com/iNBMl1Z
Code:'fields' => [ [ 'name' => __( 'Group', 'your-text-domain' ), 'id' => $prefix . 'group_6rzszh8tdbl', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Taxonomy Advanced', 'your-text-domain' ), 'id' => $prefix . 'taxonomy_advanced_hm330v010b', 'type' => 'taxonomy_advanced', 'taxonomy' => ['category'], 'field_type' => 'checkbox_tree', ], ], ], ],Long Nguyen
ModeratorHi,
Yes, it is possible. You just need to remove the setting
reciprocalwhen registering the relationship. If on aproject1post, you selectservice1post related then on the postservice1, it will showproject1connected automatically without redoing manually.February 19, 2022 at 9:53 AM in reply to: ✅How to translate custom field labels for different admin users languages ? #33998Long Nguyen
ModeratorNothing more. I've just re-synced the template file POT to get new strings. Then re-sync the language template with the POT file to start translating 🙂
Long Nguyen
ModeratorHi,
You can try to use the WP function
get_current_screen()to check the current screen https://developer.wordpress.org/reference/functions/get_current_screen/or use this code to get the current post ID and check some cases based on the post ID
$post_id = null; if ( isset( $_GET['post'] ) ) { $post_id = intval( $_GET['post'] ); } elseif ( isset( $_POST['post_ID'] ) ) { $post_id = intval( $_POST['post_ID'] ); }Long Nguyen
ModeratorHi Joshua,
Could you please share your feedback about Meta Box? It will help us to improve our plugin.
-
AuthorPosts