Title: WP-Auto Image Grabber
Author: Meitar
Published: <strong>2010 年 10 月 31 日</strong>
Last modified: 2011 年 2 月 28 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-auto-image-grabber.svg)

# WP-Auto Image Grabber

 作者：[Meitar](https://profiles.wordpress.org/meitar/)

[下载](https://downloads.wordpress.org/plugin/wp-auto-image-grabber.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-auto-image-grabber/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-auto-image-grabber/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-auto-image-grabber/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-auto-image-grabber/#developers)

 [支持](https://wordpress.org/support/plugin/wp-auto-image-grabber/)

## 描述

Inserts an image from a page you link to at the start of your blog post. A simple
algorithm tries to get a “main content” image (rather than an advertisement), automatically
providing your post with relevant, attributed artwork. This is especially useful
for bloggers who syndicate posts to sites like Facebook or Digg, which use the first
image in a post as a thumbnail for their post.

This plugin **requires PHP 5**; sites running on PHP 4 will produce fatal errors.

By default, the plugin will follow the first link in your blog post and grab what
it thinks is an appropriate main content image from there. If your posts follow 
a particular structure or pattern, you can tell the plugin to follow a certain link(
such as a link with a particular `class`) by setting the `Pointer element for destination
page` value to an XPath query that returns the link you want.

For instance, the following XPath query will match the first link with a class of`
grab-me`:

    ```
    //a[@class="grab-me"][1]
    ```

Here’s an XPath query that will match the first link within the very last paragraph
of your post:

    ```
    //p[position()=last()]/a[1]
    ```

For more XPath (and XQuery) syntax examples, refer to the [XPath specification at the W3C](http://www.w3.org/TR/xpath/).
If you’re a developer, you may also find several [XPath tools](https://developer.mozilla.org/en/XPath#Tools)
helpful.

Additionally, this plugin allows you to set a custom `class` value on the `<img>`
element that it adds to your post by specifying it in the `Image class value` setting.
For maximum compatibility, consider using one of the [WordPress-generated classes](https://codex.wordpress.org/CSS#WordPress_Generated_Classes)
most themes utilize. For instance, using `alignright` will probably make the automatically-
added image float to the right.
 This plugin uses [PHP5’s DOMDocument methods](http://www.php.net/manual/en/book.dom.php)
to parse both your post and the remote page. It uses [XPath](http://en.wikipedia.org/wiki/XPath)
to query the DOM.

## 屏幕截图

[⌊The WP-Auto Image Grabber plugin options.⌉⌊The WP-Auto Image Grabber plugin options
.⌉[

The WP-Auto Image Grabber plugin options.

## 安装

 1. Download the plugin file.
 2. Unzip the file into your ‘wp-content/plugins/’ directory.
 3. Go to your WordPress administration panel and activate the plugin.

## 常见问题

  Will the plugin change my posts, database, or anything else?

No; this plugin uses [WordPress filters](https://codex.wordpress.org/Plugin_API/Filter_Reference)
to make changes on-the-fly. It does not change the content of your posts in any 
way, and it uninstalls cleanly, without leaving a trace. 🙂

  Does the plugin save the images or offer any caches?

No, not at this time, but I’m hoping to add this optional capability to future versions
of the plugin. ([Patches welcome](http://github.com/meitar/wp-auto-image-grabber/issues).)

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP-Auto Image Grabber」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Meitar ](https://profiles.wordpress.org/meitar/)

[帮助将「WP-Auto Image Grabber」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-auto-image-grabber)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-auto-image-grabber/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/wp-auto-image-grabber/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-auto-image-grabber/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-auto-image-grabber/)。

## 更新日志

#### 0.3.1

 * Fix bug causing plugin to throw fatal error when remote document could not be
   parsed.

#### 0.3

 * New option to customize the remote main image search patterns.
 * Fix bug where plugin didn’t activate with proper default options.
 * Minor code cleanup.

#### 0.2

 * Minor code clarity improvements, more comprehensive “main image” pattern matching.

#### 0.1

 * Initial development version.

## 额外信息

 *  版本 **0.3.1**
 *  最后更新：**16 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.6 或更高版本 **
 *  已测试的最高版本为 **3.1.4**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-auto-image-grabber/)
 * 标签
 * [automation](https://cn.wordpress.org/plugins/tags/automation/)[images](https://cn.wordpress.org/plugins/tags/images/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-auto-image-grabber/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/wp-auto-image-grabber/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-auto-image-grabber/reviews/)

## 贡献者

 *   [ Meitar ](https://profiles.wordpress.org/meitar/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-auto-image-grabber/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TJLPJYXHSRBEE&lc=US&item_name=Donation%20to%20support%20WP%2dAuto%20Image%20Grabber%20plugin&item_number=wp%2dauto%2dimage%2dgrabber&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)