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
评论列表(0条)