Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi,
Before declaring the variable
$meta_box, just like the variable$prefixthat I've noted above.$mark = false; if( condition ) { $mark = true } $prefix = '123'; $meta_boxes[] = [ 'title' => esc_html__( 'Signature', 'text-domain' ), 'id' => 'signature', 'post_types' => ['docs'], 'context' => 'normal', 'priority' => 'high', ...Long Nguyen
ModeratorHi Ben,
You can use the action rwmb_{$meta_box_id}_after_save_post and the function wp_update_post() to update the post title after saving a specific meta box.
Here is the sample code:
add_action( 'rwmb_versionning_after_save_post', 'update_post_title' ); function update_post_title( $post_id ) { // Get the field value $my_meta = rwmb_meta( 'version', '', $post_id ); // Get the post title $my_post_title = get_the_title( $post_id ); // Preprare update post $my_post = array( 'ID' => $post_id, 'post_title' => $my_post_title . ' ' . $my_meta, ); wp_update_post( $my_post ); }Long Nguyen
ModeratorHi Ben,
If the condition happens on loading, you can just check the condition when registering the meta box
if( condition ) { $mark = true } $prefix = '123'; ... 'readonly' => $mark,If the condition happens on live (click/type), you need to use some JavaScript code to add the
readonlyattribute after binding an action. Follow this topic for more information https://stackoverflow.com/questions/18690463/how-to-add-the-readonly-attribute-with-jquery-or-javascript-but-following-the-w.February 24, 2021 at 9:25 PM in reply to: ✅More than one taxonomy/taxonomy_advanced field = last instance overrides others #24617Long Nguyen
ModeratorHi,
I do not see any issue with your code when testing on my local site. Screen record https://share.getcloudapp.com/04uJWOGK.
You can try to use different variable $prefix to re-check it.
$prefix1 = 'category_feed_short_'; $prefix2 = 'category_feed_';Long Nguyen
ModeratorHi,
I've tested to run your code on my local site but not see any issue. Screen record https://share.getcloudapp.com/ApuRDAdR.
Look at your screen record, I do not see the error text "This field is required." under the empty field.
Can you please re-test your case in a fresh install of WordPress and Meta Box?
Long Nguyen
ModeratorHi,
It might relate to the permalink structure, please refer to this topic https://support.metabox.io/topic/problems-creating-custom-fields/.
Long Nguyen
ModeratorHi Toni,
I recommend using the table to keep lines in one row.
https://css-tricks.com/complete-guide-table-element/
https://www.w3schools.com/html/html_tables.aspFebruary 24, 2021 at 9:46 AM in reply to: ✅Accessing Category Custom Field at Post level in Elementor #24608Long Nguyen
ModeratorHi Ian,
Sorry for the late reply.
I've checked this case one more time and see that it cannot explore this function with Elementor to get the term meta on the single post. I also add a feature request to the to-do list of the development team to check the compatibility of Elementor's future updates.
Long Nguyen
ModeratorHi Martin,
The extension MB Columns helps you to achieve your goal.
Get more details on this documentation https://docs.metabox.io/extensions/meta-box-columns/.
February 23, 2021 at 3:04 PM in reply to: ✅Settings page not showing in top level, only as submenu #24587Long Nguyen
ModeratorHi David,
Please update the new version of MB Builder 4.0.5 or MB AIO 1.13.4 then clear the cache and re-check this issue.
Let me know how it goes.
Long Nguyen
ModeratorHi guys,
Please update the new version of MB Builder 4.0.5 or MB AIO 1.13.4 to export field groups.
February 23, 2021 at 2:50 PM in reply to: ✅jQuery.Deferred exception: options.ajax is undefined #24585Long Nguyen
ModeratorHi Austin,
Please follow the step Debugging Information of the topic below to troubleshoot this issue.
https://support.metabox.io/topic/how-to-create-a-new-topic/Let me know how it goes.
Long Nguyen
ModeratorHi Austin,
Can you please clarify your case? Or share the code that creates the custom fields, I will check it on my end.
Long Nguyen
ModeratorHi,
Thank you for your reporting.
Understand it. I'm going to add this case to the to-do list of the development team to improve the behavior of the ajax submit form.
February 23, 2021 at 11:25 AM in reply to: ✅Massive bug found (?) with relationships between posts and users!!!! #24575Long Nguyen
ModeratorHi JC,
- I've tried to reproduce the issue on my local site but not see an issue like that.
- Create a new user
- Create a new post
- Access the database and set the user ID match with the post ID
- Create a relationship between user and post (reciprocal = true)
- Delete the user
- The post still there
So I suppose that the user has created that post and when you delete the user, the post is deleted too.
- If a user and a post are the same ID and have a connection, the select field will show double connect. I will discuss it with the developer team to cover this case.
-
AuthorPosts