Merhaba arkadaşlar,
$oyuncuadi='Deneme';
$parent_term = term_exists( $oyuncuadi, 'oyuncular' );
$parent_term_id = $parent_term['term_id'];
if(!$parent_term_id){
$aaaaaa=wp_insert_term($oyuncuadi,'oyuncular');
$eklenen_oyuncu=$aaaaaa['term_id'];
wp_set_post_terms( $postid, $eklenen_oyuncu, 'oyuncular' );
}else{
wp_set_post_terms( $postid, $parent_term_id, 'oyuncular' );
$oyuncuresim='http://82.222.152.134/fotogaleri/haber_icerik/images/ogretmen-mazeret-.jpg';
$get1 = wp_remote_get( $oyuncuresim );
$type1 = wp_remote_retrieve_header( $get1, 'content-type' );
$mirror1 = wp_upload_bits($oyuncuadi.".jpg", '', wp_remote_retrieve_body( $get1 ) );
$attach_id1 = wp_insert_attachment( $attachment, $mirror1['file'], $postid );
$attach_data1 = wp_generate_attachment_metadata( $attach_id1, $mirror1['file'] );
update_tax_meta($parent_term_id, $attach_id1, $attach_data1 );
}Oyuncu var mı yok mu kontrolü çalışıyor.
Ancak oyuncu yoksa oyuncunun resmini çekmeye çalışıyorum
Resimde çekiliyor ancak taxonomy alanına kaydetmiyor.
Teşekkür ederim.
@truser;