內容簡介
這個外掛在 wp-admin 文章編輯畫面提供了一個額外可排序的欄位,讓你可以依附加在文章中所有附件的檔案大小來排序文章。如果你的文章有 10 張圖片附件,顯示的數字將會是這 10 張圖片所有檔案大小的總和。這對於有大量圖片庫的 WordPress 網站非常有用。
使用方法
安裝外掛後使用上方的指示啟用。可排序的 wp-admin 欄位將會自動加入。
你也可以使用提供的 shortcode 回傳檔案大小。使用方法如下:
[pas_display_post_size post_id=false single=false return="both"]
post_id = 文章 ID(如果 single = true 時,則使用附件 ID)[非必要項目]
single = 如果你只需要單一附件的大小,就設為 true (如果是真的,一定要設定 post_id 為附件 ID)
return = 預設為 both:回傳原始的檔案大小(單位為位元組)和格式化的值。
使用 byte 回傳位元組值。
使用 formatted 回傳格式化的檔案大小
外掛標籤
開發者團隊
原文外掛簡介
This plugin provides an additional sortable column in the wp-admin Posts screen that allows you to sort the posts by total size of all attachments. If your post has 10 images attached, the number shown will be the total file size of all 10 images added together. This is useful for WordPress websites with a lot of photo galleries.
Usage
Simply install the plugin and activate using the directions above. The sortable wp-admin column will be added automatically.
You can also use the shortcode provided to return the file sizes. Usage is as follows:
[pas_display_post_size post_id=false single=false return="both"]
post_id = The post ID (if single = true then use the attachment ID) [OPTIONAL]
single = Set to true if you only want the size of ONE attachment (MUST set the post_id to the attachment ID if this is true)
return = Default both: returns both the raw byte size of the file AND the formatted value.
Use byte to return JUST the byte value.
Use formatted to return JUST the formatted file size
