[wordpress插件] Daniy Image Manager丹尼图片管理器

wordpress 插件 文章 2020-04-12 03:20 476 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

——— WARNING!

———警告!

———– This plugin may cause conflict if you also use some plugins for Markdown.

———–如果您还将某些插件用于Markdown,则此插件可能会导致冲突。

They might utilize the same table field with this plugin, causing the data to be overwritten each other.

他们可能会使用与此插件相同的表字段,从而导致数据彼此覆盖。

You must choose: this plugin or that markdown plugin gets activated.

您必须选择:此插件或markdown插件被激活。

Getting attachments with get_posts() function is one query, extracting its size and file location is another call to wp_postmeta where all data about an attachment is stored.

使用get_posts()函数获取附件是一个查询,提取其大小和文件位置是对wp_postmeta的另一次调用,其中存储了有关附件的所有数据。

So if you have 20 images in a post, you’ll end up with additional 21 queries.

因此,如果帖子中有20张图片,那么您最终将获得21条查询。

More queries means more load time for your server to response a request from browser.

更多查询意味着服务器需要更多的加载时间来响应来自浏览器的请求。

Daniy Image Manager pull a post attachments from the wp_posts and wp_postmeta ONCE when the single page is requested, then the result is cached and stored in the vacant post_content_filtered field in wp_posts table.

当请求单个页面时,Daniy Image Manager从wp_posts和wp_postmeta ONCE提取帖子附件,然后将结果缓存并存储在wp_posts表的空post_content_filtered字段中。

This means, on the next call to the same single page will also pull the attachments saved data in post_content_filtered field.

这意味着,在下一次调用相同的单个页面时,也会将附件保存的数据拉到post_content_filtered字段中。

All we have to do is unserialize it and output to browser.

我们要做的就是将它反序列化并输出到浏览器。

No more get_posts() or get_children() queries to database

不再有对数据库的get_posts()或get_children()查询

安装步骤

    1. Upload plugin-name.php to the /wp-content/plugins/ directory
    2. plugin-name.php 上载到 / wp-content / plugins / 目录

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

    5. To show post thumbnails in archive pages, put

      要在存档页面中显示帖子缩略图,请放入 <?php imwp_view_thumbnail();。

      ?> tag within the WordPress Loop of your archive.php/ category.php/ other archive template file.

      您的archive.php / category.php /其他归档模板文件的WordPress循环中的?> 标记。

      This will show your preferred post thumbnail.

      这将显示您的首选帖子缩略图。

      If not set, it will look for the last attachment attached to the post.

      如果未设置,它将查找帖子附加的最后一个附件。

      If the post has no attachments, it will show a default image.

      如果该帖子没有附件,它将显示默认图像。

    6. To show post attachment galleries, put

      要显示帖子附件库,请放入 <?php imwp_view_thumbnail();。

      ?> tag on your single.php template, preferably after

      您的single.php模板上的?> 标记,最好在 <?php the_content();之后;

      ?> tag

      ?> 标签

下载地址
https://downloads.wordpress.org/plugin/daniy-image-manager.zip
-EOF-

AI助手支持GPT4.0