Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi again,
I found the problem for your situation. Your check doesn't run when post is updated, because there's no
$GET['post']. In that case, you need to get post ID via$_POST. Here is the code:function prefix_parent_page_id_check() { $parents = get_post_ancestors( prefix_get_post_id() ); return $parents && 901 == array_pop( $parents ); } function prefix_get_post_id() { if ( isset( $_GET['post'] ) ) { return intval( $_GET['post'] ); } if ( isset( $_POST['post_ID'] ) ) { return intval( $_POST['post_ID'] ); } return false; }Anh Tran
KeymasterWhy don't you use
parentrule? It's supported by default 😉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
KeymasterDear kotofey,
We do support slide and fade in 1.5, just set toggle_type to either
fadeorslideto do so. For more information, check the documentation.Cheers!
September 9, 2017 at 9:01 AM in reply to: Conditional Logic does not work with MB Frontend Submission #6929Anh Tran
KeymasterHi buddy!
Please update to the latest version (1.5) which supported frontend submission extension.
Cheers!
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
-
AuthorPosts