Title: Slug for attached posts by image galleries
Author: clapas
Published: <strong>2011 年 3 月 17 日</strong>
Last modified: 2011 年 3 月 17 日

---

搜索插件

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

![](https://s.w.org/plugins/geopattern-icon/slug4apig.svg)

# Slug for attached posts by image galleries

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

[下载](https://downloads.wordpress.org/plugin/slug4apig.zip)

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

 [支持](https://wordpress.org/support/plugin/slug4apig/)

## 描述

Slug4apig (Slug for attached posts from image galleries) is probably the simplest
plugin ever seen, though of
 imperative need for the WordPress community.

This plugin just adds a field to each image inserted through the WordPress built-
in gallery interface. As easy as you edit
 the name, description, etc. for each 
image, with Slug4apig you will be able to edit the friendly URL (aka slug) and set
the desired value.

By default, the WordPress built-in gallery will set the attachment post’s slug to
the name of the image you inserted in
 the gallery (minus .extension). This is a
rather restrictive approach, as your images may have sequencial names assigned automatically
by the photo camera, like “S4100001.JPG”.

In the previous example, an autocreated attachment post would be created under the
hypothetical URL:

    ```
    http://example.com/2011/03/post-title/S4100001/
    ```

and a search on, i.e. Google, will show “S4100001” as the title for the page, which
is senseless for the search
 engine users, robots, and SEO activities in general.
Suppose the image is from a bike; then you will like the URL to be relevant, like:

    ```
    http://example.com/2011/03/post-title/bike/
    ```

wich is SEO friendly. There is no magic, you just set the attachment post name to
overwrite the default with the name
 of your choice!

Remember to use valid, unreserved characters for the slug. Characters that are allowed
in an URI but do not have a
 reserved purpose are called unreserved. These include
uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and
tilde.

### Future enhancements

 * Slug name validation
 * Batch jobs support

## 安装

Slug4apig is probably the simplest plugin ever seen. No configuration, nor code 
insertion is needed:

 1. Upload `Slug4apig.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

And that’s it!

## 常见问题

  What slug name do I give to my images?

Any relevant one, as long as it uses valid, unreserved ASCII characters: {[a-z],[
A-Z], [0-9], -, _, ., ~} or,
 textually {uppercase and lowercase ASCII letters, 
decimal digits, hyphen, period, underscore, and tilde}. Special characters like 
ñ, ü, and the like, will rise problems.

For the time being, no check is performed on the slug name chosen by the user.

  Why should I give a slug name to all my images?

As stated by the [Clean URL Wikipedia article](http://en.wikipedia.org/wiki/Clean_URL),

there is aesthetic, usability and search engine optimization (SEO) purposes, as 
long as some other considerations.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Slug for attached posts by image galleries」是开源软件。 以下人员对此插件做出了
贡献。

贡献者

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

[帮助将「Slug for attached posts by image galleries」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/slug4apig)

### 对开发感兴趣吗?

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

## 额外信息

 *  版本 **1.0**
 *  最后更新：**15 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 2.5 或更高版本 **
 *  已测试的最高版本为 **3.0.5**
 *  语言
 * [English (US)](https://wordpress.org/plugins/slug4apig/)
 * 标签
 * [seo](https://cn.wordpress.org/plugins/tags/seo/)[slug](https://cn.wordpress.org/plugins/tags/slug/)
 *  [高级视图](https://cn.wordpress.org/plugins/slug4apig/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/slug4apig/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/slug4apig/reviews/)

## 贡献者

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

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/slug4apig/)

## 捐助

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

 [ 捐助此插件 ](http://www.pascualyco.com/)