Forum Replies Created
-
AuthorPosts
-
Necdet Emre Ozpalamutcu
ParticipantHi,
I've run into an issue again, how do I update the text field inside the group?$data3 = [ 'tracking_history_data_group' => [ ['awaiting_confirmation_thistory' => $testDate], ['booking_confirmed_thistory' => 'value11'] ] ]; \MetaBox\CustomTable\API::update( $post_id, "aaypmz_recoveroo_tracking_history", $data3 );Tried this but doesn't work.
Necdet Emre Ozpalamutcu
ParticipantI can't believe it I missed the [ ] brackets on the values, thank you so much now it works, thanks
Necdet Emre Ozpalamutcu
ParticipantHi again,
Here is another issue ๐When I add Key Value using the above code, this is the entry in the database column:
a:2:{s:8:"TestKey1";s:10:"TestValue1";s:8:"TestKey2";s:10:"TestValue2";}
And when I add it through the GUI, this is the database entry:
a:2:{i:0;a:2:{i:0;s:8:"TestKey1";i:1;s:10:"TestValue1";}i:1;a:2:{i:0;s:8:"TestKey2";i:1;s:10:"TestValue2";}}
The issue is that the Key Value is added to the database, however it won't show on the GUI unless the entry is same as the second format above, how do I make it so that it shows up on the post type edit screen.
Necdet Emre Ozpalamutcu
ParticipantHi,
Still doesn't work, here is the updated code:add_action('save_post', function ($post_id) {
$data2 = [ 'tracking_history_data' => 'testKey', 'testvalue' ];
\MetaBox\CustomTable\API::add( $post_id, "aaypmz_recoveroo_tracking_history", $data2 );
}
});Necdet Emre Ozpalamutcu
ParticipantHi,
I wrote this code but doesn't add anything to the key value field or the database:add_action( 'init', function($post_id) {
$data = [ 'tracking_history_data' => 'keyTest', 'valueTest' ];
\MetaBox\CustomTable\API::add( $post_id, "aaypmz_recoveroo_tracking_history", $data );
}, 99 ); -
AuthorPosts