Support Forum Β» User Profile

Forum Replies Created

Viewing 15 posts - 3,151 through 3,165 (of 3,702 total)
  • Author
    Posts
  • Anh TranAnh Tran
    Keymaster

    I tested with the same code for page and the meta box is not shown in the edit page. Do you use any other condition elsewhere? Or is the meta box hid by the Screen Options?

    in reply to: Incompatibility with yoast premium plugin #3591
    Anh TranAnh Tran
    Keymaster

    Hmm, Yoast is always a trouble :(. We had a problem with their JS once when they updated the free plugin to 3.0 version. And now the premium version :(.

    Can you send me the premium version to email [email protected] to check? I don’t have it.

    in reply to: Add more button on the top of the group #3590
    Anh TranAnh Tran
    Keymaster

    Ah, yes, you’re right. The code I posted above is for the dev version on Github πŸ™‚

    in reply to: Image field does not charge for different users #3571
    Anh TranAnh Tran
    Keymaster

    What are the role of the users? Do they have permission to upload images to the Media Library?

    in reply to: class_exists issue #3567
    Anh TranAnh Tran
    Keymaster

    Oh, I didn't notice that. Thanks a lot for reporting. I've just updated the extension with the fix.

    Anh TranAnh Tran
    Keymaster

    Why don't use use std for fields? So when creating a new post, all fields have default values. If an user wants another value, he can change it manually.

    in reply to: Add more button on the top of the group #3561
    Anh TranAnh Tran
    Keymaster

    You can use filters to move the add more button to the top of the group:

    add_filter( 'rwmb_FIELD_ID_begin_html', function( $output, $field ) {
        $output .= RWMB_Clone::add_clone_button( $field );
        return $output;
    }, 10, 2 );
    add_filter( 'rwmb_FIELD_ID_end_html', function( $output, $field ) {
        return RWMB_Field::call( 'element_description', $field ) . '</div>';
    } );

    Note that this doesn't change the behaviour of the button, e.g. when clicking on it, the new clone will be added to the bottom of the group.

    in reply to: Displaying Grouped Data on Frontend #3560
    Anh TranAnh Tran
    Keymaster

    Hey Ben,

    This sample code registers a group of fields: contact name, contact email, contact phone number:

    add_filter( 'rwmb_meta_boxes', 'prefix_register_contacts' );
    function prefix_register_contacts( $meta_boxes ) {
        $meta_boxes[] = array(
            'title' => __( 'Contacts', 'textdomain' ),
            'post_types' => 'post',
            'fields' => array(
                array(
                    'id' => 'contacts',
                    'type' => 'group',
                    'clone' => true,
                    'fields' => array(
                        array(
                            'id' => 'name',
                            'type' => 'text',
                            'name' => __( 'Name', 'textdomain' ),
                        ),
                        array(
                            'id' => 'email',
                            'type' => 'text',
                            'name' => __( 'Email', 'textdomain' ),
                        ),
                        array(
                            'id' => 'phone',
                            'type' => 'text',
                            'name' => __( 'Phone', 'textdomain' ),
                        ),
                    ),
                ),
            ),
        );
        return $meta_boxes;
    }

    In the single.php, you can add the following code to display contacts:

    $contacts = rwmb_meta( 'contacts' );
    if ( ! empty( $contacts ) ) {
        foreach ( $contacts as $contact ) {
            echo '<div class="contact">';
            echo '<h4>', __( 'Contact info', 'textdomain' ), '</h4>';
            echo '<p><label>', __( 'Name:', 'textdomain' ), '<label> ', $contact['name'], '</p>';
            echo '<p><label>', __( 'Email:', 'textdomain' ), '<label> ', $contact['email'], '</p>';
            echo '<p><label>', __( 'Phone number:', 'textdomain' ), '<label> ', $contact['phone'], '</p>';
            echo '</div>';
        }
    }
    in reply to: Display data from cloned fields #3559
    Anh TranAnh Tran
    Keymaster

    Hi,

    The contact field is a cloned field, so it has values as an array. To output its values, you need to use a foreach loop, as this:

    $settings = get_option( 'ims_settings' );
    $field_id = 'ims_settings_default_mf_company_contact';
    if ( !empty( $settings[$field_id] ) && is_array( $settings[$field_id] ) ) {
        foreach ( $settings[$field_id] as $field_value ) {
            echo $field_value, '<br>';
        }
    }
    in reply to: βœ…Error updating and install #3538
    Anh TranAnh Tran
    Keymaster

    Hi Flikweert, thanks for reporting it. I will check it soon later today.

    in reply to: Groups Functionality #3537
    Anh TranAnh Tran
    Keymaster

    I'm sorry but the price for the Group can't be changed.

    Your code doesn't work because you don't have the Group extension. Please consider buying it.

    in reply to: Validation not working on FIle or File Advanced Field #3525
    Anh TranAnh Tran
    Keymaster

    Sorry, the validation hasn't worked for media fields for now :(. We use complicated JS to handle upload/insert files and generate the HTML dynamically. That makes the validation JS not work πŸ™

    in reply to: Fatal error: Class 'RWMB_Core' not found #3524
    Anh TranAnh Tran
    Keymaster

    Can you give me more info about your system?

    1) Do you install the Meta Box as a standalone plugin? I see you included in a plugin, but is it also installed as a standalone plugin?
    2) Which PHP version are you using?

    in reply to: βœ…Seem to be having issues in child theme #3518
    Anh TranAnh Tran
    Keymaster

    I think I answered this question in this topic. Please try.

    in reply to: βœ…Please add Output #3517
    Anh TranAnh Tran
    Keymaster

    Thanks for your idea. We're planing to do this πŸ™‚

Viewing 15 posts - 3,151 through 3,165 (of 3,702 total)