Forum Replies Created
-
AuthorPosts
-
December 22, 2021 at 9:19 AM in reply to: Drag & Drop Issue (or Important Missing Feature Request) #32815
Long Nguyen
ModeratorHi Sam,
Thank you for your feedback.
The feature request to drag and drop subfields outside and inside to a group is on our development queue. Hopefully, it will available soon.
Regarding the extension MB Conditional Logic, it supports passing a custom callback function (JavaScript). I think it's more flexible to show/hide a field. Please get more details on the documentation https://docs.metabox.io/extensions/meta-box-conditional-logic/#custom-callback
Long Nguyen
ModeratorHi,
If you use the Builder to create the tabs and custom fields, you can drag and drop to re-order the tabs and fields.
If you are using the code to register the tabs and custom fields, just move a tab above another to re-order them.December 21, 2021 at 9:14 PM in reply to: ✅Change name of custom post type but dont want to disappear all posts #32802Long Nguyen
ModeratorHi Paul,
You can change the Plural name, Singular name to another but you have to keep the current CPT slug to make the current posts available. Refer to this article https://metabox.io/move-custom-post-type-custom-field-data-from-pods-to-meta-box/
Long Nguyen
ModeratorHi,
MB Builder does not support getting the user name to use as the custom folder name. You need to use the PHP code to get the user name and assign it to the setting
upload_dir. For example, this code gets the current user name to use as a folder name.function your_prefix_function_name1( $meta_boxes ) { $current_user = wp_get_current_user(); $user_login = $current_user->user_login; $meta_boxes[] = [ 'title' => __( 'Post Meta1', 'your-text-domain' ), 'id' => 'post-meta1', 'fields' => [ [ 'id' => 'file', 'name' => 'File', 'type' => 'file', 'upload_dir' => ABSPATH . '/myfolder/' . $user_login . '/', ], ], ]; return $meta_boxes; }Get more details on the documentation
https://docs.metabox.io/fields/file/#upload-to-custom-folder
https://developer.wordpress.org/reference/functions/wp_get_current_user/December 21, 2021 at 8:42 PM in reply to: ✅Deleting custom post_type with frontend submission form permanently deletes post #32799Long Nguyen
ModeratorHi,
You can use this filter
pre_delete_postto check the post type and return the functionwp_trash_post(). Here is the example:add_filter( 'pre_delete_post', function( $null, $post, $force_delete ) { if( 'job' == $post->post_type && $force_delete == false ) { return wp_trash_post( $post->ID ); } return $null; }, 10, 3 );Source https://github.com/WordPress/WordPress/blob/master/wp-includes/post.php#L3392
Long Nguyen
ModeratorHi,
I do not have ETA for this fix, hopefully, it will be available soon. And here is the link to download version 1.15.2
(removed)
I will remove it after 2 days.December 21, 2021 at 12:39 PM in reply to: ✅MB Blocks get_the_ID() does not work in preview/gutenberg editor #32793Long Nguyen
ModeratorHi Michele,
You can use the variable
$post_idwith the settingsrender_callbackorrender_templateto get the current post ID when you preview the custom block in the backend. Please get more details on this documentation https://docs.metabox.io/extensions/mb-blocks/#render_callbackLong Nguyen
ModeratorHi Michele,
You can use the parameter
query_argsto pass thepost_statusto the query to get posts by status. For examplefunction your_prefix_function_name() { MB_Relationships_API::register( [ 'id' => 'post-to-page', 'from' => [ 'object_type' => 'post', 'post_type' => 'post', ], 'to' => [ 'object_type' => 'post', 'post_type' => 'page', 'field' => [ 'query_args' => [ 'post_status' => array( 'publish', 'draft' ) ], ], ], ] ); }Refer to MB Relationships documentation https://docs.metabox.io/extensions/mb-relationships/#syntax
and WordPress query https://developer.wordpress.org/reference/classes/wp_query/#status-parametersLong Nguyen
ModeratorHi,
You need to add some CSS code and JS code to the View to show images as a carousel on your site. Here is an example: https://www.w3schools.com/howto/howto_js_slideshow.asp
Long Nguyen
ModeratorHi Daniel,
You can use the field appearance filter
rwmb_{$field_id}_end_htmlto add some HTML code with field value after the field. For example:add_filter( 'rwmb_test_text_field_end_html', function( $end, $field, $meta ) { $end = 'custom HTML displayed after the field output that I would like to be dynamic - ' . $meta . '</div><!-- .rwmb-input -->'; return $end; }, 10, 3 );Replace the field ID
test_text_fieldwith your real ID. Refer to this documentation https://docs.metabox.io/filters/#rwmb_end_htmlLong Nguyen
ModeratorHi Kyle,
It is not possible to register/modify the custom field in the template file (even with Twig). I think you can use the extension MB Conditional Logic to show a required text field if another field is empty.
https://docs.metabox.io/extensions/meta-box-conditional-logic/Long Nguyen
ModeratorHi AJ,
You are welcome to share private information via the contact form https://metabox.io/contact/.
We also mention this in the support policyWe do not support via email. Our contact form is used for sending private info (in case users don't want to public it in the support forum), refund requests and cooperation suggestions.We want to users create the topic in the public forum because Meta Box works like a framework. There are a lot of cases to use Meta Box to build your WordPress site and it would be better for other customers to search and find the solution in the public forum instead of creating the same questions.
Please share your video via the contact form, I will check the issue and get back to you as soon as possible.
Long Nguyen
ModeratorHi Cees,
-
Yes, you can use the extension MB Relationships to re-order the connected posts. It uses the field type
select_advancedwithclonesettings. -
Please contact Oxygen support to ask for showing MB Relationships in Oxygen repeater. Refer to this documentation https://docs.metabox.io/extensions/mb-relationships/
December 20, 2021 at 12:21 PM in reply to: New to REST API: can I retrieve locations from another website? #32760Long Nguyen
ModeratorHi,
Yes, you can fetch data from another website via WP REST API to get post and custom fields. Here is an example https://rudrastyh.com/wordpress/rest-api-get-posts.html
December 20, 2021 at 11:13 AM in reply to: ✅"ghost pixels" due to select_advanced field in frontend submission form #32759Long Nguyen
ModeratorHi,
I do not see the space under the frontend submission form when using the field
select_advanced. Can you please share your page URL? I will help you to check this issue.You can also try to deactivate all plugins except Meta Box, MB extensions and switch to the standard theme of WordPress to troubleshoot the issue.
-
-
AuthorPosts