Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,401 through 2,415 (of 3,702 total)
  • Author
    Posts
  • in reply to: MB Relationships - Using each_connected multiple times #8410
    Anh TranAnh Tran
    Keymaster

    No problem. Here is the code for registering relationships:

    add_action( 'mb_relationships_init', function () {
    	MB_Relationships_API::register( array(
    		'id'   => 'posts_to_pages',
    		'from' => 'post',
    		'to'   => 'page',
    	) );
    	MB_Relationships_API::register( array(
    		'id'   => 'posts_to_posts',
    		'from' => 'post',
    		'to'   => 'post',
    	) );
    } );

    And here is the code to fetch connections (in index.php file):

    global $wp_query;
    MB_Relationships_API::each_connected( array(
    	'id'       => 'posts_to_pages',
    	'from'     => $wp_query->posts,
    	'property' => 'connected_pages',
    ) );
    
    MB_Relationships_API::each_connected( array(
    	'id'       => 'posts_to_posts',
    	'to'       => $wp_query->posts,
    	'property' => 'connected_posts',
    ) );

    Here is the code in the content.php file:

    foreach ( $post->connected_pages as $post ) : setup_postdata( $post );
    	the_title();
    endforeach;
    wp_reset_postdata();
    
    echo '<hr>';
    
    foreach ( $post->connected_posts as $post ) : setup_postdata( $post );
    	the_title();
    endforeach;
    wp_reset_postdata();
    in reply to: How to hide group field when post field is empty? #8409
    Anh TranAnh Tran
    Keymaster

    Hi, the problem is your post field ID. On the editing screen, the #post is used for the post form, so you can't use ID post. You need to change the ID of the post field.

    Then, you can hide the group if the field is null with this condition:

    'hidden' => array( 'post2', '=', '' ), // post2 is post field ID.

    PS: Please renew your license to get updates of extensions and support.

    in reply to: Ask about "image_advanced" field. #8385
    Anh TranAnh Tran
    Keymaster

    We’ve just realized this problem and we’re working this.

    PS: It's fixed in the version 1.2.2. Please update.

    in reply to: How to add a custom id to the "rwmb-meta-box" wrapper #8383
    Anh TranAnh Tran
    Keymaster

    Hi UG,

    1. If that's the case, then you can use the id automatically created by WordPress. Each meta box will have a unique ID the same as the ID settings. See this screenshot:

    https://imgur.elightup.com/yP1KjMq.png

    2. I've seen the issues with the code. No need screenshot anymore. I will check and fix it asap.

    3. I've checked and seen the fields appear before .edit-tag-actions. Here is how it appears on my side:

    https://imgur.elightup.com/M7XcDOv.png

    PS: To upload the screenshot, you can use this app: https://getsharex.com/. It auto uploads images to imgur.com after taking screenshots. Then just paste the image URL here.

    in reply to: Ask about "image_advanced" field. #8381
    Anh TranAnh Tran
    Keymaster

    Yes, you can. Just set a setting 'max_file_uploads' => 1 for the field (see docs).

    Or better use the single_image field. It's created for this exact purpose. See docs.

    in reply to: image_upload field and MB Settings Page #8380
    Anh TranAnh Tran
    Keymaster

    Hi, your code seems to correct. When specify limit it returns an array of single image. So you might want to do this:

    $images = rwmb_meta( 'field_id', array(
        'object_type' => 'setting',
        'size'        => 'thumbnail',
        'limit'       => 1,
    ), 'options_name' );
    $image = reset( $images );
    echo $image['url'];
    in reply to: Custom forum posts #8379
    Anh TranAnh Tran
    Keymaster

    Please send me via email. Thanks.

    in reply to: MB Relationships - Admin edit panels #8378
    Anh TranAnh Tran
    Keymaster

    Hi, this is a good idea. I planned to worked with admin columns. I will make a not on that.

    in reply to: MB Relationships - Using each_connected multiple times #8375
    Anh TranAnh Tran
    Keymaster

    Hello,

    I've just tested again with a similar code and here is my result:

    https://imgur.com/a/3FpVk

    Can you check your code again please?

    in reply to: Not compatible with MB Builder? #8373
    Anh TranAnh Tran
    Keymaster

    Hi,

    The MB Builder hasn't supported the MB Term Meta yet. But you can get over it with "Custom Attributes" for meta box. Switch to "Settings" tab and set a custom attribute "taxonomies" and enter your taxonomy slug into the input, like in this screenshot:

    https://imgur.elightup.com/ZwsLeKM.png

    We'll update the plugin to make it easier for selecting taxonomies in the next version.

    in reply to: MB Relationships - API for setting relationships #8369
    Anh TranAnh Tran
    Keymaster

    Hi, I've just added the CRUD API to the extension. I will release the new version soon.

    PS: Just released new version 1.1.0. Please see this documentation for usage.

    in reply to: MB Relationships – bi-directional relationships #8368
    Anh TranAnh Tran
    Keymaster

    My bad. I thought it's possible for "from" side only. I will work on that now and update the plugin asap.

    PS: It's done. I will update the extension soon.

    PS2: Just released version 1.1.0. Please update.

    in reply to: MB Relationships - Connection Metadata? #8367
    Anh TranAnh Tran
    Keymaster

    It should be able. I've just received the bug report and will work on that now.

    PS: I'm done. Will update the extension tomorrow.

    in reply to: switch field shows a checkbox also in front end #8349
    Anh TranAnh Tran
    Keymaster

    Hi, I've just tested with the 2017 theme and it works. Probably there's some CSS conflicts with your theme. If that's the problem, please add some CSS to adjust it.

    in reply to: How to add a custom id to the "rwmb-meta-box" wrapper #8348
    Anh TranAnh Tran
    Keymaster

    Hi UG,

    Thanks for your questions.

    1. Currently, the wrapper div is not extendable. Can you tell me why do you need an ID?

    2. Does the custom field have the name setting? Can you post a screenshot? It suppose to have the same table layout as other WordPress fields for terms.

    3. That's right. It's the only place that WordPress provides hook to show other custom fields. We can't change it.

Viewing 15 posts - 2,401 through 2,415 (of 3,702 total)