[wordpress插件] Advanced Custom Fields: Image Crop Add-on高级自定义字段:图像裁剪附件

wordpress 插件 文章 2020-01-26 20:40 604 0 全屏看文

AI助手支持GPT4.0

评分

88

88

描述

ACF image crop is an extended version of the native Image-field in ACF.

ACF图像裁剪是ACF中本机图像字段的扩展版本。

The field gives the developer/administrator the option to predefine a size for the image, which the user is prompted to crop on the various edit screens.

该字段为开发人员/管理员提供了预定义图像尺寸的选项,系统会提示用户在各种编辑屏幕上进行裁剪。

This solves the common issue of images being cropped inappropriately by the automated center-crop, that wordpress performs.

这解决了wordpress所执行的自动中心裁剪不当裁剪图像的常见问题。

The plugin supports the defined image sizes as well as a custom option, enabling the developer to specify the dimensions from within the field edit screen.

该插件支持定义的图像尺寸以及自定义选项,使开发人员可以在字段编辑屏幕中指定尺寸。

The field can be configured to enforce a hard crop or a minimal-dimension-based crop.

可以将该字段配置为强制硬性作物或基于最小尺寸的作物。

The hard crop will lock the aspect ratio of the crop where as the minimal-dimension-based crop will not allow the user to crop the image below the specified dimensions.

硬作物将锁定作物的纵横比,因为基于最小尺寸的作物将不允许用户将图像裁剪到指定尺寸以下。

This plugin diverts from plugins like Manual Image Crop in that when the user crops an image, a new

此插件从手动图像裁剪之类的插件中转移出来,因为当用户裁剪图像时,

attachment is generated, so that the relevant crop only applies in the context it is edited.

生成附件,以便相关的裁切仅适用于编辑的上下文。

It also keeps the user from dealing with the concept of various image sizes.

它还使用户不必处理各种图像尺寸的概念。

As of version 1.0 the field can be configured to either create the cropped image as a media-item (the default behavior) or simply create it and refer directly to the file without adding it to the media library.

从1.0版开始,可以将该字段配置为将裁剪后的图像创建为媒体项目(默认行为),或者简单地创建它并直接引用该文件而不将其添加到媒体库中。

This will prevent the media library from being cluttered with several cropped versions of the same image.

这将防止媒体库被同一图像的多个裁剪版本弄乱。

When this option is selected the only available return type for the field is URL.

选择此选项后,该字段唯一可用的返回类型是URL。

Compatibility

兼容性

This add-on will work with:

该插件可以使用:

    • version 4 and up
    • 版本4及更高版本

安装步骤

This add-on can be treated as both a WP plugin and a theme include.

此附加组件可以被视为WP插件和主题包含。

Plugin

插件

    1. Copy the ‘acf-image_crop’ folder into your plugins folder
    2. 将“ acf-image_crop”文件夹复制到您的插件文件夹中

    3. Activate the plugin via the Plugins admin page
    4. 通过“插件管理”页面激活插件

    Include

    包含

      1. Copy the ‘acf-image_crop’ folder into your theme folder (can use sub folders).

      2. 将“ acf-image_crop”文件夹复制到您的主题文件夹中(可以使用子文件夹)。

        You can place the folder anywhere inside the ‘wp-content’ directory

      3. 您可以将文件夹放置在“ wp-content”目录内的任何位置

      4. Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-image_crop.php file)

        编辑您的functions.php文件并添加以下代码(确保路径正确以包含acf-image_crop.php文件)

        add_action(‘acfegister_fields’, ‘my_register_fields’);

        add_action('acf / register_fields','my_register_fields');

        function my_register_fields()

        function my_register_fields()

        {
            

        {
            

        include_once(‘acf-image-crop/acf-image-crop.php’);

        include_once(‘acf-image-crop / acf-image-crop.php’);

        }

        }

下载地址

https://downloads.wordpress.org/plugin/acf-image-crop-add-on.1.4.12.zip

https://downloads.wordpress.org/plugin/acf-image-crop-add-on.1.4.12.zip

-EOF-

AI助手支持GPT4.0