0
我有變化添加圖像標題(塞),但不工作更新添加圖像標題和蛞蝓
function update_attachment($post_ID) {
$post=get_post($post_ID);
$old_name=$post->post_name;
$my_post = array(
'ID' => $post_ID,
'name' => $old_name."--".rand(1111,9999),
);
wp_update_post($my_post);
return $post_ID;
}
add_filter('add_attachment', 'update_attachment', 10, 2);