[WordPress] 外掛分享: Presswell Art Direction

首頁外掛目錄 › Presswell Art Direction
WordPress 外掛 Presswell Art Direction 的封面圖片
100+
安裝啟用
★★★★★
5/5 分(2 則評價)
127 天前
最後更新
問題解決
WordPress 4.0+ v1.1.12 上架:2018-04-11

內容簡介

Presswell Art Direction 可以協助簡化自訂圖片縮圖大小的定義、裁切和產生。

功能

使用熱點來控制圖片裁切
選擇 WordPress 編輯器中的自訂圖片尺寸
動態生成圖片縮圖
刪除所有快取的縮圖

圖片裁切

Presswell Art Direction 加入了對於媒體庫中所有圖片設置聚焦點熱點的功能,以進一步控制圖片的裁切。只需識別照片的主題在哪裡,插件就會裁切所有自訂縮圖,以確保主題保持在畫面中。

縮圖大小

Presswell Art Direction 提供了一個易於使用的介面,可用於定義和編輯自訂圖片縮圖大小。在插入文章時,可以選擇自訂圖片尺寸。

動態圖片

Presswell Art Direction 防止自訂圖片尺寸自動產生。當上傳新圖片時,只會生成標準 WordPress 縮圖。當通過代碼調用或通過 URL 請求時,所有其他圖片尺寸將動態生成,這樣在定義多個自訂圖片尺寸時能節省服務器空間。注意:基於 URL 的圖像生成需要啟用美麗的永久連結。

文檔

pwad_add_image_size( $args )

$args (array) (required) – 包含 name,key,height,width 和可選 thumbnails 值的鍵入散列;縮圖鍵以父節點的關鍵字為前綴,例如 ‘[size]-[thumbnail]’

範例:

pwad_add_image_size( array(
'name' => '正方形',
'key' => 'square',
'width' => '1200',
'height' => '1200',
'thumbnails' => array(
array(
'name' => '中等',
'key' => 'medium',
'width' => '800',
'height' => '800',
),
array(
'name' => '小',
'key' => 'small',
'width' => '400',
'height' => '400',
),
),
) );

pwad_get_image( $attachment_ID, $size_key, $thumbnail_key )

$attachment_ID (int) (required) – 圖像附件的 ID
$size_key (string) (required) – 圖像尺寸標識符;使用 ‘[size]-[thumbnail]’ 模式進行重載
$thumbnail_key (string) (required) – 圖片尺寸縮略圖標識符

返回圖像標籤。

範例:

$square_large = pwad_get_image( $img_ID, 'square' );
$square_medium = pwad_get_image( $img_ID, 'square', 'medium' );
$square_small = pwad_get_image( $img_ID, 'square-small' ); // 重載

pwad_get_image_src( $attachment_ID, $size_key, $thumbnail_key )

$attachment_ID (int) (required) – 圖像附件的 ID
$size_key (string) (required) – 圖像尺寸標識符;使用 ‘[size]-[thumbnail]’ 模式進行重載
$thumbnail_key (string) (required) – 圖片尺寸縮略圖標識符

返回一個包含 file、url、path、height、width 和 mime-type 值的鍵入散列。

範例:

$square_large = pwad_get_image_src( $img_ID, 'square' );
$square_medium = pwad_get_image_src( $img_ID, 'square', 'medium' );
$square_small = pwad_get_image_src( $img_ID, 'square-small' ); // 重載

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.12) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Presswell Art Direction」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Presswell Art Direction helps simplify how custom image thumbnail sizes are defined, cropped, and generated.
Features

Control image cropping with hot-spots
Select custom image sizes in the WordPress editor
Dynamically generate image thumbnails
Delete all cached thumbnails

Image Cropping
Presswell Art Direction adds the ability to set a focal point hot-spot for all images in the media library for fine grain cropping control. Simply identify where the subject of the photo is and the plugin will crop all custom image thumbnails to ensure it stays in frame.
Thumbnail Sizes
Presswell Art Direction adds an easy to use interface for defining and editing custom image thumbnail sizes. Custom image sizes will be available for selection when inserting images in the post editor.
Dynamic Images
Presswell Art Direction prevents custom image sizes from being generated automatically. Only standard WordPress thumbnails will be generated when a new image is uploaded. All other image sizes will be dynamically generated when called via code or requested via URL, saving server space when many custom image sizes are defined. Note: URL based image generation requires that pretty permalinks are enabled.
Documentation
pwad_add_image_size( $args )

$args (array) (required) – Keyed array containing name, key, height, width, and optionally thumbnails values; Thumbnail keys are prefixed with parent’s key like ‘[size]-[thumbnail]’

Example:
pwad_add_image_size( array(
'name' => 'Square',
'key' => 'square',
'width' => '1200',
'height' => '1200',
'thumbnails' => array(
array(
'name' => 'Medium',
'key' => 'medium',
'width' => '800',
'height' => '800',
),
array(
'name' => 'Small',
'key' => 'small',
'width' => '400',
'height' => '400',
),
),
) );

pwad_get_image( $attachment_ID, $size_key, $thumbnail_key )

$attachment_ID (int) (required) – ID of image attachment
$size_key (string) (required) – Image size identifier; Overload using ‘[size]-[thumbnail]’ pattern
$thumbnail_key (string) (required) – Image size thumbnail identifier

Returns an image tag.
Example:
$square_large = pwad_get_image( $img_ID, 'square' );
$square_medium = pwad_get_image( $img_ID, 'square', 'medium' );
$square_small = pwad_get_image( $img_ID, 'square-small' ); // Overloaded

pwad_get_image_src( $attachment_ID, $size_key, $thumbnail_key )

$attachment_ID (int) (required) – ID of image attachment
$size_key (string) (required) – Image size identifier; Overload using ‘[size]-[thumbnail]’ pattern
$thumbnail_key (string) (required) – Image size thumbnail identifier

Returns a keyed array containing the file, url, path, height, width, and mime-type values.
Example:
$square_large = pwad_get_image_src( $img_ID, 'square' );
$square_medium = pwad_get_image_src( $img_ID, 'square', 'medium' );
$square_small = pwad_get_image_src( $img_ID, 'square-small' ); // Overloaded

延伸相關外掛

文章
Filter
Apply Filters
Mastodon