Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterStrange, I've just tested with your code and it works. Do you have any "check" code that runs along with (maybe before) the code for Meta Box?
Anh Tran
KeymasterHi,
It's recommended to use a hook like 'plugins_loaded', 'init' or better - activation hook to create a new table. In case of a theme, you can hook into 'init', like this:
add_action( 'init', 'prefix_create_table' ); function prefix_create_table() { if ( ! class_exists( 'MB_Custom_Table_API' ) ) { return; } MB_Custom_Table_API::create( 'my_custom_table', array( 'address' => 'TEXT NOT NULL', 'phone' => 'TEXT NOT NULL', 'email' => 'TEXT NOT NULL', ), array( 'email' ) ); }For more info, please see the sub-section E. in the section Notes of the documentation.
Anh Tran
KeymasterHi,
The 'std' value works only the first time, e.g. when you haven't save any settings. In your case, if you delete the field value, then the plugin should "remember" your choice - whatever you did - which is the empty value in this case. It would be much confused if it shows the 'std' value, because two things: 1) you wonder where it comes from and 2) you can't actually save an empty value.
Anh Tran
KeymasterCan I see your function for test top parent page ID? Can you post your code?
Anh Tran
KeymasterHi,
I've just tried your code with Conditional Logic plugin enabled. Everything works as expected.
Maybe the problem is in the custom JavaScript code, which might breaks the JS code in the plugin(s). Can you please check when exactly the post doesn't save image_select value?
September 11, 2017 at 2:13 PM in reply to: How to set meta_query of Group cloneable fields for search #6949Anh Tran
KeymasterHi,
When you use cloneable fields (whether it's a group or not), the data is saved as a serialized array in the database. That makes the default meta_query doesn't work when search for posts by meta value.
In this case, you need to use a plugin like SearchWP.
Anh Tran
KeymasterHi,
You can run a SQL query like this:
DELETE FROM wp_postmeta WHERE meta_key IN ('field1', 'field2');Anh Tran
KeymasterNo problem, refund is sent.
If you change your mind, we'll be happy to help.
Anh Tran
KeymasterI'm afraid this is a hard problem. As the
file_uploaduses Media Library to upload files, all it does is calling the popup, passing the required parameters for the uploader (mime types, file size, etc.) and parsing the returned data. I've just checked the code and couldn't find anything related to the current field, because the uploader doesn't need that. But can you tryprint_reverything global ($_POST,$_GET, etc.) when filtering? Probably I'm missing something.August 26, 2017 at 9:17 AM in reply to: ✅Group not saving new items, overwriting old ones. Big mess. #6771Anh Tran
KeymasterHi,
I've just tested your code and here is the recorded screen:
I guess the problem is caused by cached JavaScript. In every new version of Group extension, most of the changes are in JavaScript file. So please try clearing browser cache (or Ctrl-F5) and check it again.
Thanks,
AnhAnh Tran
KeymasterThe URL param is used to make sure if users reload the current page, no info is submitted again. It’s quite a common thing in PHP form.
I’m not clear about this thing: when users edit a second meta box, it should be the 2nd form, which is different from the previous form. So it must have different div for the submit status and couldn’t show the previous messange.
Can you plz make a screenshot so I can look at the issue closer?
Thanks
August 25, 2017 at 10:44 PM in reply to: ✅MB Group 1.0.6 throws an error and does not render fields #6766Anh Tran
KeymasterCan you please update to the latest version? It’s already 1.2.11 now.
Anh Tran
Keymaster@ludovic.meyer: Cool trick! Thanks.
Anh Tran
KeymasterCan I ask how do you change upload folder? Do you use WordPress hooks?
Anh Tran
KeymasterHi Johnny,
You can use PHP function
array_spliceto insert new fields at any position, like this:$field_1 = array(...); $position = 1; array_splice( $meta_boxes[$k]['fields'], $position, 1, array( $field_1 ) ); // Do the same for $field_2, etc.For more info, please see this docs.
-
AuthorPosts