1
我想在上传新图像时清除图像标题中的默认“文件名”。我尝试使用下面的代码,没有运气。如何清除WordPress上传的默认附件标题?
add_action('add_attachment', 'my_upload_title', 99);
function my_upload_title($attachment_ID) {
$the_post = array();
$the_post['ID'] = $attachment_ID;
$the_post['post_title'] = '';
wp_update_post($the_post);
}
感谢您的快速回复@Shiekh Heera!不幸的是,这两个答案在WP 3.5中似乎都不起作用。 有趣的是,图像对齐,链接类型和大小有一个“update_option”函数。 –