media_post_single_attachment_fields_to_edit

函式
media_post_single_attachment_fields_to_edit ( $form_fields, $post )
引數
  • (array) $form_fields An array of attachment form fields.
    Required:
  • (WP_Post) $post The WP_Post attachment object.
    Required:
返回值
  • (array) Filtered attachment form fields.
定義位置
相關方法
media_single_attachment_fields_to_editimage_attachment_fields_to_editget_attachment_fields_to_editimage_attachment_fields_to_savewp_ajax_send_attachment_to_editor
引入
2.8.0
棄用
-

media_post_single_attachment_fields_to_edit函式是一個WordPress過濾器,允許開發者修改在編輯單個附件文章時顯示的欄位。它接受兩個引數:一個欄位陣列和附件物件。開發人員可以使用這個過濾器來新增或刪除欄位,或修改現有欄位的屬性。

檢索文章的非影象附件欄位,以編輯表格欄位。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
unset( $form_fields['image_url'] );
return $form_fields;
}
function media_post_single_attachment_fields_to_edit( $form_fields, $post ) { unset( $form_fields['image_url'] ); return $form_fields; }
function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
	unset( $form_fields['image_url'] );
	return $form_fields;
}

常見問題

FAQs
檢視更多 >