Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterIf you still see the error in the future, feel free to create another topic.
Anh Tran
KeymasterI've just tried a cloneable group with a color field and doesn't see that bug. Also, the code to remove the default '#' is added to Meta Box quite a long time ago. Can you give me more details on that? How did you setup the meta boxes?
Anh Tran
KeymasterUnfortunately, it's not supported at the moment. Taxonomy field (and user, post fields) stores the term IDs in the database.
Anh Tran
KeymasterThat code above belongs to cmb2 plugin, which is a totally a different thing. Meta Box and cmb2 works similar but they don't share any common API. I couldn't understand why it can generate the fatal error above.
Anh Tran
KeymasterThe
fieldset_textalways set thetypeattribute totext(in the normalization method), so the only way to change that tonumberis hook to the normalize filter, like this:add_filter( "rwmb_normalize_{$field_id}_field", function ( $field ) { $field['attributes']['type'] = 'number'; return $field; } );Anh Tran
KeymasterLooks like your host doesn't support unzip or has some problem while unzipping. I have found some topics about the same problem, please take a look:
https://wordpress.org/support/topic/pclzip_err_bad_format-4/
http://stackoverflow.com/questions/17771578/wordpress-theme-upload-error-pclzip-err-bad-format
Anh Tran
KeymasterThe value of cloneable fields is stored as a sanitized array in 1 meta field and should be imported correctly IF you setup the same code on the imported site. Can you check that?
Anh Tran
KeymasterYou shouldn't use 2 taxonomy fields with the same
taxonomy, because taxonomy field sets the post terms, which makes 2 fields share the same value.You should use
taxonomy_advancedinstead. It works exactly the same astaxonomy, but doesn't set the post terms (and saves value as CSV in the post meta).Anh Tran
KeymasterWordPress uses
_thumbnail_idmeta key for the thumbnail. Its value is the ID of the featured image. So you can totally use any of image fields for it.Anh Tran
KeymasterI got it. To get
$fieldinadd_actionsmethod, you can use this snippet:$args = func_get_args(); $field = $args[0];It would do the trick.
By the way, why don't you just hook to
rwmb_after_save_postfrom outside the field class?Anh Tran
KeymasterHi Chris, let me check it and will get back to you.
Anh Tran
KeymasterIf you just want to revert the default value for the old post, you can just run this code:
$post_id = 123; // Your post ID $field_id = 'abc'; // The field ID $default = 'some thing'; // Default value update_post_meta( $post_id, $field_id, $default );Put it in a functionality plugin and run it once.
Anh Tran
KeymasterYes, you can. You need to install the plugin Text Limiter first, then follow this guide to add rules to the field using custom attribute:
https://metabox.io/docs/meta-box-builder/#section-custom-attributes
Anh Tran
KeymasterHi David,
You can use custom attributes from MB Builder to add conditions for Include Exclude extension. Please follow these guides:
https://metabox.io/docs/meta-box-builder/#section-custom-attributes
https://metabox.io/docs/how-to-create-nested-array-field-with-meta-box-builder/Anh Tran
KeymasterHmm, I've just tried including the plugin into 2 test plugins and it doesn't generate any error: http://prntscr.com/cr8ix3
Here is the test1/2 plugin main file:
<?php /** * Plugin Name: Test 1 * Plugin URI: * Description: * Version: 1.0 */ require_once 'meta-box/meta-box.php';Meta Box plugin is put in
meta-boxfolder inside the plugin http://prntscr.com/cr8j6v.The test for
RWMB_VERconstant is not needed as the plugin already check that. -
AuthorPosts