Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterI see. That syntax is for PHP >= 5.4 which supports short array syntax. Please try:
$room_show_img = RWMB_Image_Field::file_info( $room_img_id, array( 'size' => 'thumbnail' ) );It's better to upgrade to PHP 7.2, the performance is twice better than PHP 5.
September 13, 2019 at 8:29 AM in reply to: ✅License key says invalid and edit/save link also broken #16106Anh Tran
KeymasterHi, please deactivate the Meta Box Updater module in AIO. It's no longer needed since the updater is merged into Meta Box.
FYI: new version of AIO includes free extensions as well, so you might want to remove them from the plugin list.
Anh Tran
KeymasterI got it. Thanks for the clarification.
I'm afraid there's no way to detect a field is closed or open, especially in different context (classic or block editor).
At the moment, the queries when page loads are minimal as they query only selected items. I don't think that's a performance bottle neck.
Anh Tran
KeymasterHi,
What do you mean "not php object way"? Is there any relation with PHP 5.6?
Anh Tran
KeymasterHi Mauro, you can disable the manual entry by setting
'readonly' => true.Anh Tran
KeymasterHi Daniel,
Could you please provide more info? Is this like creating a field to select saved templates from page builders?
Anh Tran
KeymasterHi,
Doesn't the
stdsettings work? You can get the current post info (post ID is grabbed from$_GET) and put the post info in thestdsettings for the fields.September 12, 2019 at 10:56 AM in reply to: ✅Received license key renewal receipt, but plugin has not been updated #16085Anh Tran
KeymasterHi,
Can you please give me more details on how you "enter them in our relevant WP plugins"? Do you set the license key programmatically?
Anh Tran
KeymasterGlad you like it.
Do you want to remove an ajax query when users open a closed relationships field? I understand "closed relationship field" is a field that users already chose items for the relationship, right?
Well, what if users want to change a selected item to something else? We still need to make ajax query to fetch other items for users to change.
FYI, if a field already has some selected items, only once query is made when page loads (not via ajax). It makes sure the selected items is visible in the dropdown.
If field has no selected items, no queries are created when page loads. Queries are created only via ajax.
Anh Tran
KeymasterUpdate: the ajax + pagination is enabled by default and works for terms and users. Please use the latest version on ajax-post branch on Github:
https://github.com/wpmetabox/meta-box/tree/ajax-post
Please try it before I release a new version.
Anh Tran
KeymasterHi Paul,
This is done on Github (the ajax-post branch). Can you please try it before I release a new version:
Anh Tran
KeymasterHi again,
I've done the relationships for
post. Please follow this guide to use it:- Download the latest dev version of MB Relationships on Github.
- Download the latest dev version of Meta Box for ajax post on Github
Now try it again and you'll see the ajax requests are sent when open the dropdown.
If you want to customize the ajax request, in your code to register relationships, use this code:
add_action( 'mb_relationships_init', function () { MB_Relationships_API::register( array( 'id' => 'users_to_posts', 'from' => array( 'object_type' => 'post', 'meta_box' => array( 'title' => 'Manages', ), 'field' => array( 'ajax' => true, // Note this 'query_args' => array( 'posts_per_page' => 10, // This is for pagination in Ajax ), 'js_options' => array( 'minimumInputLength' => 1, // Send ajax requests when users enter at least 1 character ), ), ), 'to' => array( 'object_type' => 'post', 'post_type' => 'page', 'meta_box' => array( 'title' => 'Managed By', 'context' => 'side', 'empty_message' => 'No users', ), 'field' => array( 'ajax' => true, // Note this 'query_args' => array( 'posts_per_page' => 10, // This is for pagination in Ajax ), ), ), ) ); } );Some notes:
- Now in the relationship, you'll have an extra
fieldsettings, which you can pass full settings array for the field. It's similar topost,taxonomyoruserfield. - Enable
ajaxfor the dropdown by adding'ajax' => trueto the field - If you just want to query only some posts via ajax (not all of posts at once), you can set
posts_per_pageparameter.
Currently, it works for posts only. I'll make it works for terms and users by tomorrow.
September 10, 2019 at 9:19 AM in reply to: ℹ️METABOXERS! Help get OxygenBuilder integration by upvoting this github issue #16054Anh Tran
Keymaster@saint: no, the extensions just work. The integration will help pulling the data to output on the front end easier.
I've marked this topic as super sticky. Guys, please upvote!
Anh Tran
KeymasterHi Chris, thanks for your bug report. I'll check and fix it.
-
AuthorPosts