wpessential/wpessential-images

WPEssential Images 帮助在WordPress中进行图像注册。

2.0.1 2024-09-10 22:55 UTC

This package is auto-updated.

Last update: 2024-09-10 22:58:33 UTC


README

帮助注册WordPress中的图像。

composer require wpessential/wpessential-images

将单个图像添加到WordPress注册表

$prefix ='wpe';
$images = \WPEssential\Library\Images::make( $prefix );
$images->add([
	'size'  => [ 'w' => 1980, 'h' => 9999 ],
	'croup' => true
]);
$images->init();

将多个图像添加到WordPress注册表

$prefix ='wpe';
$images = \WPEssential\Library\Images::make( $prefix );
$images->add([
	[
		'size'  => [ 'w' => 1920, 'h' => 1080 ],
		'croup' => true
	],
	[
		'size'  => [ 'w' => 1980, 'h' => 9999 ],
		'croup' => true
	]
]);
$images->init();

从WordPress注册表中删除单个图像

$prefix ='wpe';
$images = \WPEssential\Library\Images::make( $prefix );
$images->remove('1920x1080');
$images->init();

从WordPress注册表中删除多个图像

$prefix ='wpe';
$images = \WPEssential\Library\Images::make( $prefix );
$images->remove(['1920x1080']);
$images->init();