Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi,
Please remove the code (three times)
array ( 'id' => $prefix . '', ),which renders input fields, see my screenshot https://cl.ly/b9a30d9456eb
Long Nguyen
ModeratorHi,
A new update has been released, please update MB AIO to the new version 1.11.3 or MB Views extension v1.1.1 to check it out.
Let me know how it goes.
April 17, 2020 at 1:59 PM in reply to: ✅MB_Relationships_API::each_connected Returns Empty Array #19090Long Nguyen
ModeratorHi,
A new update has been released, please update MB AIO to the new version 1.11.3 or MB Relationships extension v1.9.2 to check it out.
Let me know how it goes.
Long Nguyen
ModeratorHi Austin,
By default, the field
textareauseswp_kses_postas the callback function to sanitize as we've noted in the documentation.This function allows you to insert the HTML tag
<style><script>such as custom CSS, JS code in the settings page whilesanitize_textarea_fieldstrips all tags.For more information, please follow the documentation
https://developer.wordpress.org/reference/functions/wp_kses_post/
https://developer.wordpress.org/reference/functions/sanitize_textarea_field/April 17, 2020 at 11:07 AM in reply to: ✅Example of moving wooCommerce meta to a custom table? #19087Long Nguyen
ModeratorHi,
Thank you for contacting us. Hope you are well today.
The extension MB Custom Table helps you to create a custom table and support to save the post meta (fields) which is created by Meta Box easily.
https://docs.metabox.io/extensions/mb-custom-table/#using-custom-tablesAnd you can also save any post meta to the custom table but WooCommerce or other plugins have its own procedure to save its own meta to the database. For example, WooCommerce saves the product meta SKU, Price, Stock Quantity ... to the table
wc_product_meta_lookupSo if you want to save this meta of Product, you should create action and fire when WooCommerce saves the meta and save it to the custom table.
Here are some guides for you
https://www.mootpoint.org/blog/woocommerce-hook-product-updated-added/
https://wordpress.stackexchange.com/questions/334407/get-woocommerce-product-details-and-transfer-them-to-a-custom-db-tableLong Nguyen
ModeratorHi,
You can use the hook
rwmb_frontend_after_processto check the user if not logged in then update the post status to draft and redirect to the login page.Here is the sample code
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) { if( ! is_user_logged_in() ) { // Update post $my_post = array( 'ID' => $post_id, 'post_status' => 'draft', ); // Update the post into the database wp_update_post( $my_post ); // Redirect to the page wp_redirect( home_url() ); die(); } }, 99, 2 );For more information, please follow the documentation
https://docs.metabox.io/extensions/mb-frontend-submission/#form-actions
https://developer.wordpress.org/reference/functions/is_user_logged_in/
https://developer.wordpress.org/reference/functions/wp_update_post/April 17, 2020 at 9:13 AM in reply to: ✅Custom post types or taxonomies not showing in MB View #19085Long Nguyen
ModeratorHi,
To insert the taxonomies, please use the post field
Post term list
see my screenshot https://cl.ly/d65c03f5cde2Long Nguyen
ModeratorHi,
The extension only supports one post type for each relationship register, not the array like your code
array('carburetors', 'distributors','linkage-kits','fuel', 'parts')You can create more relationships for each post type or use the reciprocal to connect all posts
https://docs.metabox.io/extensions/mb-relationships/#reciprocal-relationshipsLong Nguyen
ModeratorHi,
Thank you for contacting us.
If you are using the latest version of Meta Box v5.2.8 and Meta Box AIO v1.11.2, please share the code that you are using to create the relationship.
Below is the sample code creates the relationship between 2 post types Author and Book that I'm using and it works as well as save the data.
add_action( 'mb_relationships_init', function() { // Add CPT Relationship between Authors + Books MB_Relationships_API::register( [ 'id' => 'books_to_book_author', 'from' => [ 'object_type' => 'post', 'post_type' => 'book', 'meta_box' => [ 'title' => 'Author', 'priority' => 'high' ], ], 'to' => [ 'object_type' => 'post', 'post_type' => 'author', 'meta_box' => [ 'title' => 'Books by this author', ], ] ] ); } );Long Nguyen
ModeratorHi,
If you scroll down you will see the Generate Code box display under the Settings box, see my screenshot https://cl.ly/c58fda98e1b5
I'm going to discuss with the developer team to improve the user experience for this case.
Long Nguyen
ModeratorHi,
I'm going to check it out and let you know later.
Thank you and have a nice day.
Long Nguyen
ModeratorHi Lorenzo,
I think the Meta Box can work with this FacetWP addon because it adds a post type to each user and syncs the user meta to post meta. However, I do not have this addon so I cannot test to make sure it will compatible with Meta Box.
April 15, 2020 at 3:18 PM in reply to: ✅Add fields to Genesis Custom Post Type Archive Metabox #19052Long Nguyen
ModeratorHi,
We've had a copy of Genesis and we will try to take the look and create the code but not in a short time because we have the plan for developing for this year.
Thanks for your patience.
Long Nguyen
ModeratorHi Drake,
Because we are registering the tab before the fields which are shown on the tab as the code in the documentation so I think it's just the user experience. But I will discuss with the developer team to improve this case.
Thank you.
Long Nguyen
ModeratorHi,
Thank you for getting in touch with us.
Currently, the extension only supports to create a single relation as the documentation. Thanks for the idea, we will research and develop this feature in the next time.
Have a nice day.
-
AuthorPosts