Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterYou can defined the constant
RWMB_VERin thewp-config.phpfile. That makes both plugins won't load Meta Box.Then in the 2nd plugin, where you can edit, add the following lines:
require_once 'path-to-meta-box/inc/loader.php'; $loader = new RWMB_Loader; $loader->init();March 14, 2017 at 10:44 AM in reply to: โ How do I make the meta data show on a post page (it's not showing) #5279Anh Tran
KeymasterPlease follow this documentation to get the value and show in the page:
Anh Tran
KeymasterWhen you haven't saved any data, there's no actual data for you to get to show in the frontend. So, the code that get meta value should check for existence of the sub-field in the group before echoing it.
March 14, 2017 at 10:42 AM in reply to: How to update clone-able fields value from fronend side. #5277Anh Tran
KeymasterYou just need to format the data in an array for cloneable fields, like this:
$values = array( 'value 1', 'value 2', ); update_post_meta( $post_id, $field_id, $values );The value for each clone is the same as for non-cloneable field. You can read more info here:
https://metabox.io/docs/how-post-meta-is-saved-in-the-database/
Anh Tran
KeymasterYou can prevent Meta Box from loading by defining the constant
RWMB_VER. Then you might need to manually load the library like this:require_once 'path-to-meta-box/inc/loader.php'; $loader = new RWMB_Loader; $loader->init();Anh Tran
KeymasterMy email is [email protected]. The contact form auto sends email to my mailbox ๐
Anh Tran
KeymasterSo strange. We don't have any code that hide the menu. Can you send me an admin account to check it (via Contact page, please)?
Anh Tran
KeymasterHi, to save wysiwyg field's content into the post_content, you have to do the trick:
- Setup the post type not to support editor (using this function https://codex.wordpress.org/Function_Reference/remove_post_type_support)
- Set the wysiwyg field the id =content.If you do that, you can set the
stdvalue as the post content by querying the post content.This is the code: https://gist.github.com/rilwis/eacd78b507df951cb0450ebd38ee14ac
PS: this question is asked quite frequently, so I created a tutorial for it here with more details: https://metabox.io/docs/save-wysiwyg-content-post-content/
Anh Tran
KeymasterHi, did you login with the admin account? Can you please take a screenshot and post here?
Thanks.
Anh Tran
KeymasterHi,
Currently, our loader mechanism couldn't detect which version is older and decide to load the newer one :(. It's probably better to load the plugin from the wordpress.org with the help of TGM Activation class.
March 6, 2017 at 10:03 AM in reply to: How to display a custom file upload error in a plupload_image field? #5219Anh Tran
KeymasterHi @tgarda,
That's true. The errors are handled by the JS of plupload. The error messages are sent to JS via the file
wp-includes/script-loader.phpand then used inwp-includes/js/plupload/wp-plupload.js(line 327). I haven't found any PHP hook or how to add a custom error while uploading.March 4, 2017 at 1:42 PM in reply to: Orderby and Sort Order on frontend for Post Checkbox List. #5210Anh Tran
KeymasterThe
menu_orderis used by WP_Query which has effect only when you use a custom query.Because the
rwmb_metafunction only returns the values stored in the post meta, it doesn't use the WP_Query and thus doesn't have themenu_orderaffected. However, after you change the post order, IF you edit the post and save the post meta again, then the new values might have the new order affected.In general, if you want to make sure it always work, you should use a custom query like this:
$posts_array = rwmb_meta( '_posts_select' ); $query = new WP_Query( array( 'post_type' => 'post', 'orderby' => 'menu_order', 'order' => 'ASC', 'post__in' => $posts_array, ) ); if ( $query->have_posts() ) { while ( $query->have_posts() ) : $query->the_post(); // Do something endwhile; }Anh Tran
KeymasterHi, thanks for letting me know. The problem is the PHP function I used doesn't work with the multi-bytes languages. I've just fixed it and updated the plugin, please update.
Anh Tran
KeymasterAh, I got it. Unfortunately, this is the limitation of the plugin when working in the modal mode. WordPress limits how fields are outputted and saved. We also can't enqueue JavaScript for it as well. So, please just use the simple fields there.
Anh Tran
KeymasterCan you post the code you use? It seems to work for me ๐
-
AuthorPosts