Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,701 through 2,715 (of 3,707 total)
  • Author
    Posts
  • in reply to: Add Meta Box to Woocommerce Product data Tabs #6260
    Anh TranAnh Tran
    Keymaster

    Hi,

    Currently it's not possible yet. But you can add a separate meta box for WC products. I will look into the WC and will find if there's an API to integrate Meta Box fields for WC tabs.

    in reply to: Collapsible Attribute #6259
    Anh TranAnh Tran
    Keymaster

    Can you post your code here? I tested it many times before ๐Ÿ™

    in reply to: Collapsible Attribute #6254
    Anh TranAnh Tran
    Keymaster

    I've just tested with settings page and it works for me. Can you try in the browser private mode (with history and cookie cleared)? On some browsers like Firefox, the state of the inputs is saved by the browser, so if you open it once, it will be opened next time you access the page, regardless the settings.

    in reply to: Collapsible Attribute #6247
    Anh TranAnh Tran
    Keymaster

    Hi,

    This is a good idea! I've just added a new param for group "default_state" which accepts "collapsed" value. So you can see it collapsed by default.

    Please update group to the latest version (1.2.8).

    in reply to: WYSIWYG Editor field autoresize #6245
    Anh TranAnh Tran
    Keymaster

    Hi,

    Do you mean the "full-height editor and distraction-free functionality" settings set in the screen options:

    If it is, then it's not supported at the moment :(.

    in reply to: Disable functionality of WYSIWYG editor #6244
    Anh TranAnh Tran
    Keymaster

    Hi,

    I think the easier way to change the wysiwyg is using options parameter. Using filter is the last method you should think about. Of course this will work. I'll demonstrate both methods here:

    If you want to disable "Add Media" button, use this code:

    array(
        'type'    => 'wysiwyg',
        'name'    => 'Editor',
        'id'      => 'test_editor',
        'options' => array(
            'media_buttons' => false,
        ),
    ),

    If you want to disable the text mode), use this code:

    array(
        'type'    => 'wysiwyg',
        'name'    => 'Editor',
        'id'      => 'test_editor',
        'options' => array(
            'media_buttons' => false,
            'quicktags'     => false,
        ),
    ),

    If you want to disable visual mode, use this code:

    array(
        'type'    => 'wysiwyg',
        'name'    => 'Editor',
        'id'      => 'test_editor',
        'options' => array(
            'media_buttons' => false,
            'tinymce'       => false,
        ),
    ),

    Using filter is similar:

    add_filter( 'rwmb_wysiwyg_settings', function ( $settings ) {
        $settings['media_buttons'] = false;
        // $settings['tinymce']       = false;
        $settings['quicktags']     = false;
    
        return $settings;
    } );

    Note that using filter affects all wysiwyg fields. That's why it's more preferable to use field settings instead.

    in reply to: Google Map custom styles #6229
    Anh TranAnh Tran
    Keymaster

    FYI, the new version 4.12 of Meta Box fixed this. Please update.

    in reply to: Get an image url out of array #6222
    Anh TranAnh Tran
    Keymaster

    Hi,

    rwmb_meta( 'image_field_id' ) returns an array of image info. To get the URL of the image, simply use the code like this:

    $image_info = rwmb_meta( 'image_field_id', 'size=thumbnail' );
    echo $image_info['url']; // Thumbnail size URL
    echo $image_info['full_url']; // Full size URL
    in reply to: User role issue #6216
    Anh TranAnh Tran
    Keymaster

    Can you please try download again? I think I uploaded the wrong file.

    in reply to: User role issue #6211
    Anh TranAnh Tran
    Keymaster

    Hi,

    We probably haven't supported it yet. The user_role actually is the role for being edited users. It's not for the current user, who is editing. We'll update the extension to add more condition for the current user.

    in reply to: User role issue #6191
    Anh TranAnh Tran
    Keymaster

    Hi,

    Just realized that you asked about a field, not a meta box. The include / exclude extension works for meta boxes only, not for fields.

    So, in this situation, you probably need to use PHP code to check and register a field for a meta box. Something like:

    $fields = array(); // Define all your fields here
    if ( current_user_can( 'manage_options' ) ) {
        $fields[] = array(
            'type' => 'text',
            'name' => 'Custom field for admin only',
            'id'   => 'admin_only',
        );
    }
    
    // Register meta box
    $meta_boxes[] = array(
        'type'   => 'user',
        'title'  => 'Profile fields',
        'fields' => $fields,
    );
    in reply to: User role issue #6158
    Anh TranAnh Tran
    Keymaster

    The user_role is the role of the being edited users, not the current users. In this case, if you want to edit editor users, you need to set 'user_role' => 'editor'.

    in reply to: Cloned group with file_advanced field type #6157
    Anh TranAnh Tran
    Keymaster

    You can get file info with the helper function RWMB_File_Field::file_info( $file ), like this:

    $group = rwmb_meta('media');
    foreach($group as $data){
        $files = rwmb_meta($data['mb_file']);
        foreach($files as $file) {
            $file_data = RWMB_File_Field::file_info( $file );
            var_dump( $file_data );
        }
    }
    in reply to: Add to Select Box with PHP Loop #6144
    Anh TranAnh Tran
    Keymaster

    Hello,

    Do you want to get list of custom post types or list of posts of some custom post types?

    In 1st case, you can use the function get_post_types() to get all the post types:

    $options = array();
    $post_types = get_post_types( array(
        'public'   => true,
        '_builtin' => false
    ), 'objects' );
    foreach ( $post_types as $post_type ) {
        $options[$post_type->slug] = $post_type->name;
    }

    And in the select, just set 'options' => $options.

    In the 2nd case, you can use the field type post and set 'post_type' => 'your_post_type', and all the posts will be populated in the select option. For more info, please check this guide.

    Anh TranAnh Tran
    Keymaster

    Just updated the plugin with the fix you provided :).

    Thanks for your contribution.

Viewing 15 posts - 2,701 through 2,715 (of 3,707 total)