[wordpress插件] Automatic Thumbnail Generator自动缩略图生成器

wordpress 插件 文章 2020-02-25 15:30 885 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin will scan your thumbnail-less posts and look for a suitable image to use as a thumbnail.

此插件将扫描您的无缩略图帖子,并寻找适合用作缩略图的图像。

It will look for images linked in the post content and will download and add them to the local library.

它将查找帖子内容中链接的图像,并将其下载并将其添加到本地库中。

Post scanning is performed only when the_post_thumbnail or get_the_post_thumbnail are called for

仅当调用 the_post_thumbnail get_the_post_thumbnail 时执行后扫描。

that particular post.

该特定帖子。

So you designed your new thumbnail-based template, but you have tons of thumbnail-less posts and

因此,您设计了新的基于缩略图的模板,但是却有大量的无缩略图帖子和

don’t want to spend too much time on scraping your old posts for a thumbnail picture.

不想花太多时间抓取您的旧帖子以获取缩略图。

Maybe you

也许你

think you will probably forget to set a thumbnail for your new posts.

认为您可能会忘记为新帖子设置缩略图。

Maybe both, as was my case :).

也许两者都是,就像我的情况一样:)。

When a thumbnail for a post is queried and nothing is found this plugin will scrape the post for

查询帖子的缩略图后,如果找不到任何内容,此插件将为该帖子抓取

an tag and its href property.

标记及其 href 属性。

Once a suitabile image is found (based on the configured

找到合适的图像后(基于配置的

settings), it will be downloaded ad set as the post thumbnail.

设置),则将其下载为帖子缩略图的广告集。

If no suitable image is found,

如果找不到合适的图像,

a default one will be used.

将使用默认值。

This plugin is still in early development state.

此插件仍处于早期开发状态。

It just covers my needs (see the “To do” section

它只满足我的需求(请参阅“待办事项”部分

for more details).

更多细节)。

It has been tested only with wordpress 3.0.1, but should work also with 2.9,

仅在wordpress 3.0.1上进行了测试,但在2.9上也可以使用,

since I used similar code with 2.9 (even if it was included in my template’s functions.php).

因为我在2.9中使用了类似的代码(即使它包含在模板的 functions.php 中)。

The plugin is not supported.

不支持该插件。

This doesn’t mean that I will not look into submitted bugs.

这并不意味着我不会调查提交的错误。

Anyway,

反正

don’t expect prompt answers, since this is done in my spare time.

不要期望得到迅速的答案,因为这是我的业余时间。

To do

要做

Many things should be done in future releases.

将来的版本中应该做很多事情。

Here are some:

这里是一些:

    • Current version always downloads selected linked images.

    • 当前版本始终下载选定的链接图像。

      This works good with images hosted on external sites.

      这对于外部站点上托管的图像效果很好。

      If your posts link to images hosted in your media library, you will end up with two images.

    • 如果您的帖子链接到媒体库中托管的图像,则最终将获得两个图像。

    • A more user friendly name should be used for images added to the library (e.g. Thumbnail for post …)
    • 对于添加到库中的图像,应使用更加用户友好的名称(例如,帖子的缩略图…)

    • Somewhere, a button to reset the “previously scanned” status of all posts should be provided (on current version,

    • 在某个地方,应该提供一个按钮来重置所有帖子的“先前扫描”状态(在当前版本中,

      you cas set or reset it for single posts in the edit page.

    • 您可以在编辑页面中为单个帖子设置或重置它。

    • “previously scanned” status should probably be reset (or at least you should be asked to) when publishing a

    • 发布以前的内容时,应重置(或至少要求您)“先前扫描”状态

      updating an existing post

    • 更新现有帖子

    More ideas are wellcome.

    欢迎提出更多想法。

安装步骤

    1. Upload auto-thumbnail-generator to the /wp-content/plugins/ directory
    2. 自动缩略图生成器上传到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Just use the default the_post_thumbnail or get_the_post_thumbnail template tags
    6. 只需使用默认的 the_post_thumbnail get_the_post_thumbnail 模板标签

    After installation, you can find plugin settings in the media settings page.

    安装后,您可以在媒体设置页面中找到插件设置。

    The following settings

    以下设置

    are available:

    可用:

      • Ignore previously scanned: when checked, previously scanned posts will be re-scanned on each

      • 忽略先前扫描的内容:选中后,将在每个页面上重新扫描先前扫描的帖子

        request if no thumbnail is linked to the post

      • 请求是否没有缩略图链接到帖子

      • Uknown image: name of the image which shall be used if no thumbnail can be found for a post

      • 未知图片:如果找不到帖子的缩略图,则应使用的图片名称

        (must match the media library name of an image)

      • (必须与图片的媒体库名称匹配)

      • Minimum Width and Minimum Height: minium width and height for the selected thumbnails (no contraints

      • 最小宽度和最小高度:所选缩略图的最小宽度和高度(无约束

        if set to null or 0)

      • 如果设置为null或0)

      • Aspect ratio: aspect ratio (width/height) for the selected thumbnails (e.g. 1.5 for 3:2 ratio,

      • 纵横比:所选缩略图的纵横比(宽度/高度)(例如,对于3:2比例为1.5,

        no contraints if set to null or 0)

      • 如果设置为null或0,则没有任何限制。

      • Aspect ratio tolerance: tolerance to aspect ratio for selected thumbnails (percentage of aspect ratio,

      • 宽高比公差:所选缩略图对宽高比的公差(宽高比的百分比,

        e.g.

        例如

        0.1 tolerance with aspect ratio set to 1.5 will select images with aspect ratio raging from

        将宽高比设置为1.5的0.1容差将选择宽高比为的图像

        1.35 to 1.65)

      • 1.35至1.65)

下载地址
https://downloads.wordpress.org/plugin/automatic-thumbnail-generator.0.1.zip
-EOF-

AI助手支持GPT4.0