plugins - Get and Update Most Meta Value as an array in HTML form

I'm trying to update post meta for a meta edd_download_files the meta is in the form of an array. It is from a plug

I'm trying to update post meta for a meta edd_download_files the meta is in the form of an array. It is from a plugin so i can do it via admin, but still there is need to do it programmatically.

$simple_txt_fld = get_post_meta( $thispost->ID, 'edd_price', true );

echo print_r($simple_txt_fld);

I recieve the output like this

Array ( [index] => 0 [attachment_id] => 0 [thumbnail_size] => [name] => [file] => / [condition] => all ) 1

As I see it is an array, now i want to update the file name in the array. I created the form, and tried to update meta valued for other things, there it worked.

The code that i tried was this:

                    if ( array_key_exists('Download_File_Link', $input_values) )        {   
                            $a=$input_values['Download_File_Link'];
                                $array= Array(
                                 "index" => "0",
                                 "attachment_id"=> "0",
                                 "thumbnail_size" => "",
                                "name" => "",
                                 "file" => $a,
                                 "condition" => "all" );

                update_post_meta($postid, 'edd_download_files', $array  ); 

Here I am trying to put it in array and doesnt seem to work

It doesn't update file at all. Please help me out with a solution to update post meta in an array form

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745118885a4612295.html

相关推荐

  • plugins - Get and Update Most Meta Value as an array in HTML form

    I'm trying to update post meta for a meta edd_download_files the meta is in the form of an array. It is from a plug

    7小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信