AI助手支持GPT4.0
Unlike the traditional way of attaching images (or attachments) to posts by inserting them in the post content, this plugin allows you to attach images to posts in a manner
与通过将图片(或附件)插入帖子内容中来将图片(或附件)附加到帖子的传统方式不同,此插件可让您以以下方式将图片附加到帖子中
that lets you control the way the images are later displayed in your theme.
可以控制以后在主题中显示图像的方式。 p>
It adds a metabox to the edit screen that lets you select/upload images (similar to the “Featured Image” metabox).
它在编辑屏幕上添加了一个metabox,可让您选择/上传图像(类似于“ Featured Image” metabox)。 p>
The images attached to a post can then later be gotten by the following means:
随后可以通过以下方式获取帖子中附加的图像: p>
twp_the_post_images($size)
twp_the_post_images($ size) code>。$size (string|array) is an optional parameter (defaults to 'thumbnail') and can take values similar to the wp_get_attachment_image_src function.
$size (string|array) is an optional parameter (defaults to 'thumbnail') and can take values similar to the wp_get_attachment_image_src function.
wordpress.org/Function_Reference/wp_get_attachment_image_src“ title =” wp_get_attachment_image_src“ rel =” nofollow“> wp_get_attachment_image_src 函数。 li>
ul>
This will return an array of objects where each object contains information about an image.
这将返回一个对象数组,其中每个对象都包含有关图像的信息。 p>
twp_get_post_images($post_id, $size)
twp_get_post_images($ post_id,$ size) code>。 li>
$post_id (int): required – the ID of the post.
$ post_id(int) em>:必填–帖子的ID。 p>$size (string|array): is an optional parameter (defaults to 'thumbnail') and can take values similar to the wp_get_attachment_image_src function.//codex.wordpress.org/Function_Reference/wp_get_attachment_image_src“ title =” wp_get_attachment_image_src“ rel =” nofollow“> wp_get_attachment_image_src 函数。 p>This will return an array of objects where each object contains information about an image.这将返回一个对象数组,其中每个对象都包含有关图像的信息。 p>If you want to display the images directly as an unordered list, then you can use the shortcode [twp_post_images id=post_id size=some_size].如果要将图像直接显示为无序列表,则可以使用简码 [twp_post_images id = post_id size = some_size] code>。The parameters of this shortcode are same as those of the above functions.此短代码的参数与上述函数的参数相同。You will need some CSS knowledge to style the returned unordered list properly.您将需要一些CSS知识才能正确设置返回的无序列表的样式。 li> ul>The functions twp_the_post_images() and twp_get_post_images() return an empty array if no images were found or an array of objects where each object has the following attributes:如果未找到图像,则函数 twp_the_post_images() code>和 twp_get_post_images() code>返回空数组,或者每个对象具有以下属性的对象数组: p>>id: the attachment id id em>:附件ID li>width: The width of the image width em>:图像的宽度 li>height: The height of the image 高度 em>:图片的高度 li>orientation: The orientation of the image (landscape|protrait) orientation em>:图像的方向(风景|人物) li>url: The url of the image url em>:图片的网址 li>is_original: (boolean) false if $url is a resized image, true if it is the original. is_original em> :(布尔值)如果$ url是调整大小的图像,则为false;如果它是原始图像,则为true。 li> ul>NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION 请注意,您每次修改图像选择后都必须保存/更新您的信息 strong> p>
$size (string|array): is an optional parameter (defaults to 'thumbnail') and can take values similar to the wp_get_attachment_image_src function.
//codex.wordpress.org/Function_Reference/wp_get_attachment_image_src“ title =” wp_get_attachment_image_src“ rel =” nofollow“> wp_get_attachment_image_src 函数。 p>
[twp_post_images id=post_id size=some_size]
[twp_post_images id = post_id size = some_size] code>。The parameters of this shortcode are same as those of the above functions.此短代码的参数与上述函数的参数相同。You will need some CSS knowledge to style the returned unordered list properly.
The parameters of this shortcode are same as those of the above functions.
此短代码的参数与上述函数的参数相同。
You will need some CSS knowledge to style the returned unordered list properly.
您将需要一些CSS知识才能正确设置返回的无序列表的样式。 li>
The functions twp_the_post_images() and twp_get_post_images() return an empty array if no images were found or an array of objects where each object has the following attributes:
twp_the_post_images()
twp_get_post_images()
如果未找到图像,则函数 twp_the_post_images() code>和 twp_get_post_images() code>返回空数组,或者每个对象具有以下属性的对象数组: p>>id: the attachment id id em>:附件ID li>width: The width of the image width em>:图像的宽度 li>height: The height of the image 高度 em>:图片的高度 li>orientation: The orientation of the image (landscape|protrait) orientation em>:图像的方向(风景|人物) li>url: The url of the image url em>:图片的网址 li>is_original: (boolean) false if $url is a resized image, true if it is the original. is_original em> :(布尔值)如果$ url是调整大小的图像,则为false;如果它是原始图像,则为true。 li> ul>NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION 请注意,您每次修改图像选择后都必须保存/更新您的信息 strong> p>
twp_the_post_images() code>和 twp_get_post_images() code>返回空数组,或者每个对象具有以下属性的对象数组: p>>id: the attachment id id em>:附件ID li>width: The width of the image width em>:图像的宽度 li>height: The height of the image 高度 em>:图片的高度 li>orientation: The orientation of the image (landscape|protrait) orientation em>:图像的方向(风景|人物) li>url: The url of the image url em>:图片的网址 li>is_original: (boolean) false if $url is a resized image, true if it is the original. is_original em> :(布尔值)如果$ url是调整大小的图像,则为false;如果它是原始图像,则为true。 li> ul>NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION 请注意,您每次修改图像选择后都必须保存/更新您的信息 strong> p>
twp_get_post_images() code>返回空数组,或者每个对象具有以下属性的对象数组: p>>id: the attachment id id em>:附件ID li>width: The width of the image width em>:图像的宽度 li>height: The height of the image 高度 em>:图片的高度 li>orientation: The orientation of the image (landscape|protrait) orientation em>:图像的方向(风景|人物) li>url: The url of the image url em>:图片的网址 li>is_original: (boolean) false if $url is a resized image, true if it is the original. is_original em> :(布尔值)如果$ url是调整大小的图像,则为false;如果它是原始图像,则为true。 li> ul>NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION 请注意,您每次修改图像选择后都必须保存/更新您的信息 strong> p>
p>
>
NOTE THAT YOU HAVE TO SAVE/UPDATE YOUR POST EACH TIME YOU MODIFY THE IMAGE SELECTION
请注意,您每次修改图像选择后都必须保存/更新您的信息 strong> p>
Steps to install this plugin.
安装此插件的步骤。 p>
ol>
原文出处:http://www.sanshu.cn/a/3005.html
群主管理都是支付大佬