Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi Piero,
Only the field
filesupports uploading files to the custom folder and it does not support showing thumbnail (preview).
Please read more on the documentation https://docs.metabox.io/fields/file/February 11, 2022 at 1:19 PM in reply to: ✅Metabox dynamix data rendering page name in Oxygen #33844Long Nguyen
ModeratorHi Rasmus,
Please re-save the permalink settings (Post name) and re-check the issue. Let me know how it goes.
Long Nguyen
ModeratorHi Ole,
You can use a translation plugin to translate the label of a field on the lost password form.
Long Nguyen
ModeratorHi Dom,
You need to replace the variable
{$meta_box_id}with your real meta box ID (include the prefix)add_action('rwmb_vtl_settings_after_save_post', array($this, 'vtl_save_settings'), 20);Long Nguyen
ModeratorHi,
No, MB Views works like a template file to render the code on the frontend. You can try to use the extension MB Frontend Submission or MB User Profile to allow users to add their inputs on the frontend.
https://docs.metabox.io/extensions/mb-frontend-submission/
https://docs.metabox.io/extensions/mb-user-profile/Long Nguyen
ModeratorHi,
Meta Box does not support showing a field value based on another field value on "live" as JS does. I think you can list all your cities when registering the field city then use Ajax to update the options later.
[ 'type' => 'select_advanced', 'name' => __( 'Current City', 'awaw' ), 'id' => 'obr_user_city', // not a standard WP User field 'placeholder' => __( 'City', 'awaw' ), 'multiple' => false, 'required' => true, 'options' => [ //list all cities ], 'js_options' => [ 'tags' => false, // false disables free text input, true enables it ], ],Long Nguyen
ModeratorHi,
I'm going to check this this action hook and get back to you later.
Long Nguyen
ModeratorHi,
I do not see any issue on my site, the CPT is available on the list menu items as well, screenshot https://monosnap.com/file/XZyAVOEYDXSDxTG5vkRGun4YhaBIc4
You can try again with a fresh WordPress install to avoid any conflicting issues.
Long Nguyen
ModeratorHi,
Just focus on your main question:
The question is... how do I delete the uploaded media when I delete the custom post type entry?
Then using the custom code above will help you to delete the uploaded media when deleting a post/custom post type.
https://support.metabox.io/topic/delete-media-files-when-delete/#post-33805
"Attach" or "Unattached" status on the Media page does not relate to the code above.On the other hand, the post attached on the Media list is just used another post meta with the meta key
_wp_attached_fileand works as a custom field. See here
https://monosnap.com/file/VUeK4M9fuwRHUMsSZ5eh7ySYWIuqVy
https://monosnap.com/file/i1uEjwEDD3bf9W3FpPJX6629AMAgRiEach image uploaded will be stored in a post with the post type "Attachment", screenshot https://monosnap.com/file/zzgI45SYVflMmXi73tDFgArKulyt6n
Maybe you are confusing this post type with the "Attach" action on the Media page.February 10, 2022 at 11:25 PM in reply to: ✅How to include field groups in email sent after form submission #33833Long Nguyen
ModeratorHi,
You can just use the global variable
$_POSTto get any field value when submitting the post. For example:$group = $_POST['group_id']; $subfield1 = $group['subfield1']; $subfield2 = $group['subfield2'];February 10, 2022 at 11:09 PM in reply to: Blank space when inserting custom fields via Elementors dynamic tags #33832Long Nguyen
ModeratorHi Thomas,
Thanks for your additional information.
If you want to show a field value on a page with Elementor, this page has to have a field. For example, the FAQ fields are associated to post type FAQ so you can show these fields on the single post FAQ only. On the single page, it will not show the value, of course.
Long Nguyen
ModeratorHi Ranadeep,
You can follow this documentation to add two columns to the existing custom table https://docs.metabox.io/extensions/mb-custom-table/#using-existing-tables
Then when saving the post, you can check if the field Created_On has value, then update the time for the field Modified_On.
Refer to this documentation https://developer.wordpress.org/reference/functions/current_time/
https://docs.metabox.io/actions/#rwmb_after_save_postLong Nguyen
ModeratorHi Piero,
Please change the group ID to this one
'id' => $prefix . 'Cart',or just cart
'id' => 'Cart',and re-check the issue.
Long Nguyen
ModeratorHi Will,
You can use the filter hook
pre_get_document_titleto change the site title. For example:function change_site_title( $title ) { $field_value = rwmb_meta( 'field_id', ['object_type' => 'setting'], 'option_name' ); $title = $field_value . ' - ' . get_bloginfo('name'); return $title; } add_filter( 'pre_get_document_title', 'change_site_title', 9999 );Refer to the documentation
https://developer.wordpress.org/reference/hooks/pre_get_document_title/
https://docs.metabox.io/extensions/mb-settings-page/#getting-field-valueLong Nguyen
ModeratorHi,
The problem is the field
select_advancedonly supports saving the registered options when registering the field and meta box.[ 'name' => __( 'Select Advanced', 'your-text-domain' ), 'id' => $prefix . 'select_advanced_mgsxcpd22q', 'type' => 'select_advanced', 'options' => [ 'a' => __( 'A', 'your-text-domain' ), 'b' => __( 'B', 'your-text-domain' ), 'c' => __( 'C', 'your-text-domain' ), ], ],If you append to the select dropdown with some new option values, it will not be saved to the database.
$('#select_advanced_mgsxcpd22q').append('<option value="b">B</option>'); -
AuthorPosts