Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterI see, with your case, I'd recommended:
- A select field: Github, Gitlab, Bitbucket.
- (Optional): Three labels: Github Username, Gitlab Username, Bitbucket Username, visible when select field equal to label.
- A Text field: Username
So your
wp_postmetatable will cleaner because it only save 2 fields instead of 4, and the validation will works.Cheers!
Anh Tran
KeymasterI understand. I thought I did this in the previous version but looks like not. I will fix it so
emptywork.Thanks for noticing the bug.
Anh Tran
KeymasterDo you mean sorting options of a
select_advancedfield?Anh Tran
KeymasterI guess there is a JavaScript code that similar to this
$( '#course_cluster[]' )which is an invalid selector in jQuery. As you're using Conditional Logic plugin, this expression might be displayed by the plugin, it can be auto-generated by term ID or something. Can you check the source HTML code to see whatcourse_clusteris?Anh Tran
KeymasterThere is no reference to
course_clusteras shown in the error log. Can you add these lines intowp-config.phpand check the error message again?define( 'WP_DEBUG', true ); define( 'CONCATENATE_SCRIPTS', false ); define( 'SCRIPT_DEBUG', true );This code tells WP to not concatenate scripts and can show us the exact place of the error.
Anh Tran
KeymasterDear weseo,
Thanks for using our plugins. As your field is required, it shouldn't be hidden and vice versa, this will breaks our scripts functionality. So you can change your require validation logic if it's possible.
Best regards
Tan
Anh Tran
KeymasterCan you post the code you use to register meta boxes and custom fields?
Anh Tran
KeymasterUnfortunately no. You can only set it searches from a fix bundle of data.
Anh Tran
KeymasterDear nicolas,
I've tested with my site and it works. This is my meta box:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = array( 'id' => 'brand_product', 'title' => 'Brands and Products', 'post_types' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', // Conditional Logic can be applied to Meta Box // In this example: Show this Meta Box by default. Hide it when post format is aside 'hidden' => array( 'post_format', 'aside' ), 'fields' => array( array( 'id' => 'brand', 'name' => 'Brand', 'desc' => 'Pick Your Favourite Brand', 'type' => 'select', 'options' => array( 'Apple' => 'Apple', 'Google' => 'Google', 'Microsoft' => 'Microsoft' ) ), array( 'id' => 'apple_products', 'name' => 'Which Apple product that you love?', 'type' => 'radio', 'options' => array( 'iPhone' => 'iPhone', 'iPad' => 'iPad', 'Macbook' => 'Macbook', 'iWatch' => 'iWatch' ), // Conditional Logic can applied to fields // In this example: Show this field by default, // hide it when user selected different value than 'Apple' on brand select field 'hidden' => array( 'brand', '!=', 'Apple' ) ), array( 'name' => 'Price', 'id' => "tan_price", 'desc' => 'Input price without currency', 'type' => 'text', 'clone' => false, 'size' => 25, 'tab' => 'dish', // 'visible' => array( "{$prefix}menu_item_type", '!=', '0' ), 'hidden' => array( 'when' => array( array( "brand", 'not in', array( 'Google', 'Microsoft' ) ), array( "post_category", 1 ), ), 'relation' => 'or' ), ), ) ); return $meta_boxes; } );It hidden when either
brandis Apple orpost_categoryis 1.If this problem still persist, can you please send me your website credentials and FTP info via contact form so I can login your website to check?
Best regards,
Tan
Anh Tran
KeymasterDS conflicts with my XAMPP somehow. I couldn't make it run :(.
Anh Tran
KeymasterI'm downloading DS to test ๐
Anh Tran
KeymasterLol. I don't run VVV, neither. It's more complicated than it should be. On Mac, I'm using Valet which is super simple.
On Windows, I think XAMPP is more stable than other software. You should think switching to it ๐
Anh Tran
KeymasterI have no idea with DesktopServer. I'm using XAMPP locally and it works. I thought DesktopSever is similar to XAMPP as they're just the wrapper for Apache, MySQL and PHP.
Anh Tran
KeymasterMaybe in the Apache error log?
Also, try copy and paste the code above directly into
functions.phpof the child theme. I did that and it worked.Anh Tran
KeymasterIt's now available on wordpress.org: https://wordpress.org/plugins/mb-rest-api/
-
AuthorPosts