Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 250 total)
  • Author
    Posts
  • Tan NguyenTan Nguyen
    Participant

    Dear ludovic,

    You're right. Conditional Logic currently only works in admin. I'll check the plugin and release new update asap!

    in reply to: Geolocation not working in admin #6450
    Tan NguyenTan Nguyen
    Participant

    Dear zazezi,

    Can you please try with another fresh install to test and post your code here so I can easy to replicate it?

    in reply to: Geolocation not working in admin #6438
    Tan NguyenTan Nguyen
    Participant

    Dear zazezi,

    Can you please open the Console and copy the error if you see? If it doesn't show any error message, can you please copy your code here?

    in reply to: Core Extensions Bundle refund. #6352
    Tan NguyenTan Nguyen
    Participant

    You're right. The Columns extension will wrap fields on 12 grid. That means two wysiwyg editors are in the same row and the remaining in the same row. There is a trick to wrap 3 columns in the same row, by setting the second column to column of 5 instead of 6:

    
    array(
    	'name'    => false,
    	'id'      => "{$prefix}sect_editor",
    	'type'    => 'wysiwyg',
    	'columns' => 6,
    	'raw'     => true,
    	'options' => array(
    		'textarea_rows'     => 15,
    		'wpautop'         => false,
    	),
    ),
    
    array(
    	'name'    => false,
    	'id'      => "{$prefix}sect_editor2",
    	'visible' => ['uk_sect_layout', 'layout2'],
    	'type'    => 'wysiwyg',
    	'columns' => 5,
    	'raw'     => true,
    	'options' => array(
    		'textarea_rows'     => 15,
    		'wpautop'         => false,
    	),
    ),
    
    // Image Columns
    array(
    	'name'             	=> esc_html__( 'Section Images', 'codice' ),
    	'id'               	=> "{$prefix}sect_image",
    	'visible'          	=> ['uk_sect_layout', 'layout1'],
    	'type'             	=> 'image_advanced',
    	'columns' 			=> 6,
    	'force_delete'     	=> false,
    	'max_file_uploads' 	=> 2,
    	'max_status'       	=> false,
    ),
    
    // Layout options
    array(
    	'name'    => esc_html__( 'Layout', 'codice' ),
    	'id'      => "{$prefix}sect_layout",
    	'columns' => 3,
    	'type'    => 'select',
    	'options' => array(
    		'layout1' => esc_html__( 'Image', 'codice' ),
    		'layout2' => esc_html__( '2 Columns', 'codice' ),
    	),
    ),
    

    Please try and let me know if you have any problem.

    Cheers!

    in reply to: Core Extensions Bundle refund. #6346
    Tan NguyenTan Nguyen
    Participant

    Dear uththamag,

    Sorry to make you feel confusing, I've checked both Columns and Conditional Logic and see it works as your requested. Please see my example and let me know if you have further problems.

    Tan NguyenTan Nguyen
    Participant

    Dear uththamag,

    Imagine you have a field to select layout like so:

    
    array(
    	'name'    => __( 'Layout', 'rwmb' ),
    	'id'      => 'layout',
    	'type'    => 'select',
    	'columns' => 12,
    	'options' => array(
    		'one' => '1 Col', 
    		'two' => '2 Cols',
    		'three' => '3 Cols'
    	)
    ),
    

    To toggle a field with selected value, just add:

    
    'visible' => ['layout', 'SELECTED_VALUE'],
    

    SELECTED_VALUE can be one, two, or three like the above example.

    Tan NguyenTan Nguyen
    Participant

    Dear xoomserve,

    Here is the example which I've created with MB Builder:

    
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
    
        $meta_boxes[] = array (
          'id' => 'untitled-metabox-2',
          'title' => 'Untitled Metabox',
          'pages' =>   array (
             'post',
             'page',
          ),
          'context' => 'normal',
          'priority' => 'high',
          'autosave' => false,
          'fields' =>   array (
             
            array (
              'id' => 'properties',
              'type' => 'taxonomy',
              'name' => 'Properties',
              'taxonomy' => 'product_type',
              'field_type' => 'select',
            ),
             
            array (
              'id' => 'another_text_field',
              'type' => 'text',
              'name' => 'Text Field',
              'visible' =>       array (
                'when' =>         array (
                  array (
                     'taxonomy_2',
                     '=',
                     '4',
                  ),
                ),
                'relation' => 'and',
              ),
            ),
          ),
        );
    
        return $meta_boxes;
    }
    

    Basically, you can register your taxonomy field and another field normally. And then, in related field (Text in this example), just define your conditional logic:

    
    'visible' => ['your_taxonomy_id', '=', 'taxonomy_value']
    
    Tan NguyenTan Nguyen
    Participant

    Dear Jason,

    As you can see, it says Undefined index: badgeos in /home/40951-69099.cloudwaysapps.com/czfybpbunb/public_html/wp-content/themes/obodohub-cts-master-0.5.2/functions.php on line 438.

    Can you please fix that warning?

    Cheers!

    in reply to: Conditional Logic Custom Callback not working for me #6117
    Tan NguyenTan Nguyen
    Participant

    Dear bdthemes,

    Here is an example:

    
    add_filter( 'rwmb_meta_boxes', 'YOURPREFIX_register_meta_boxes' );
    
    function YOURPREFIX_register_meta_boxes( $meta_boxes ) {
        // Define a meta box
        $meta_box = array(
            'title'      => __( 'Media', 'textdomain' ),
            'post_types' => 'post',
            'fields'     => array(
                array(
                    'name' => __( 'URL', 'textdomain' ),
                    'id'   => 'url',
                    'type' => 'text',
                ),
            )
        );
    
        // Add new field when condition meets
        if (get_theme_mod( 'orphan_toolbar')) {
            $meta_box['fields'][] = array(
                'name'     => 'Toolbar',
                'id'       => $prefix . "toolbar", 
                'type'     => 'checkbox',
                'desc'     => 'Enable or disable the toolbar for this page.',
                'tab'      => 'layout',
            ),
        }
    
        // Add the meta box to $meta_boxes array to register
        $meta_boxes[] = $meta_box;
    }
    
    
    in reply to: Disable select option #6116
    Tan NguyenTan Nguyen
    Participant

    Dear woorie,

    Because toggle_type is affected to whole field/meta box and its container and many fields aren't normal form input field so it isn't possible. Sorry for that.

    Tan NguyenTan Nguyen
    Participant

    Dear Jason,

    Can you please tell me your PHP version, in the example I use anonymous function so perhaps it doesn't works with PHP 5.2.

    Btw, can you please turn on WP_DEBUG and/or WP_DEBUG_LOG to see the full output message. Kindly check the WP official documentation: https://codex.wordpress.org/Debugging_in_WordPress

    Best regards,
    Tan

    in reply to: Disable select option #6110
    Tan NguyenTan Nguyen
    Participant

    Dear woorise,

    The plugin is intended to show or hide field or meta box, it cannot disable a field.

    Best,

    Tan

    in reply to: Conditional Logic Custom Callback not working for me #6109
    Tan NguyenTan Nguyen
    Participant

    Dear bdthemes,

    Conditional Logic works with Javascript callback only, it doesn't works with PHP, however, with PHP, you can check if meet a condition and then register meta box or field, like so:

    
    if (get_theme_mod('orphan_toolbar')) {
        $meta_boxes = [
            ...
        ];
    }
    
    in reply to: Conditional Logic question/proposal #6091
    Tan NguyenTan Nguyen
    Participant

    Dear kotofey,

    1. Yes, I'll add it to the next minor release this month.
    2. Yes, I have already written a guide for you.
    https://metabox.io/docs/hide-meta-box-tabs-conditional-logic/

    in reply to: How to use import feature? #6042
    Tan NguyenTan Nguyen
    Participant

    Sound great. Yeah, I think in this case, thats best practice.

Viewing 15 posts - 31 through 45 (of 250 total)