Support Forum ยป User Profile

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: โœ…Adding data to key value field via PHP #38029

    Hi,
    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.

    in reply to: โœ…Adding data to key value field via PHP #37448

    I can't believe it I missed the [ ] brackets on the values, thank you so much now it works, thanks

    in reply to: โœ…Adding data to key value field via PHP #37438

    Hi 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.

    in reply to: โœ…Adding data to key value field via PHP #37428

    Hi,
    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 );
    }
    });

    in reply to: โœ…Adding data to key value field via PHP #37398

    Hi,
    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 );

Viewing 5 posts - 1 through 5 (of 5 total)