Title: Simple Stupid Shortcode
Author: lorenzck
Published: <strong>2017 年 9 月 3 日</strong>
Last modified: 2017 年 11 月 29 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

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

# Simple Stupid Shortcode

 由 [lorenzck](https://profiles.wordpress.org/lorenzck/) 開發

[下載](https://downloads.wordpress.org/plugin/simple-stupid-shortcode.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/simple-stupid-shortcode/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/simple-stupid-shortcode/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/simple-stupid-shortcode/#developers)

 [技術支援](https://wordpress.org/support/plugin/simple-stupid-shortcode/)

## 外掛說明

The usual way to include images in WordPress posts is to generate static anchor 
and `<img>` tags through the content editor interface. Similarly, links to other
posts or pages of your blog are also generated as absolute `<a>` tags by the content
editor.
 These kind of fixed links make your WordPress site hard to migrate and 
make it especially hard to automatically change your output markup (for instance
if you decide to change the image size or change a post’s title).

No longer.
 With this plug-in, you can use the simple `[image]`, `[link]`, and `[
page]` shortcodes in any of your posts.

#### Image shortcode

Images are referenced by their ID, for instance:

    ```
    [image id="123"]
    ```

This _shortcode_ will generate the following HTML structure:

    ```
    <div class="picture wp-image-123 size-medium">
      <img src="path-to-123-medium.jpg" srcset="…" />
    </div>
    ```

Images default to their `medium` size, if none is set.
 You may easily add HTML 
classes or didascalies:

    ```
    [image id="123" didascaly="Nice picture." class="aligncenter"]
    ```

This generates the following HTML block, which can be easily styled with some custom
CSS:

    ```
    <div class="picture wp-image-123 size-medium aligncenter">
      <img src="path-to-123-medium.jpg" srcset="…" />
      <div class="didascaly">Nice picture.</div>
    </div>
    ```

The `[image]` _shortcode_ supports the following parameters:

 * `id`: the WordPress ID of the attachment to include;
 * `size`: size of the image to include (can be any standard size such as `thumbnail`,`
   medium`, `full`, or any custom image size);
 * `alt`: alternate description to include in the `<img>` tag;
 * `title`: image title to use in (optional) link;
 * `link`: if set to `true`, `1`, `yes`, or an equivalent value, a link to the full-
   resolution attachment will be generated, otherwise a fully specified target URL
   can be specified;
 * `didascaly`: text to add as a didascaly;
 * `class`: additional HTML/CSS classes to add to the root element.
 * `atts`: additional HTML attributes to add to the wrapping `<div>` tag.
 * `imgatts`: additional HTML attributes to add to the internal `<img>` tag of the
   image.

#### Page and link shortcodes

This couple of _shortcodes_ automatically generate hypertext links to pages or posts
of your WordPress installation. Target posts can be referenced by ID, by _slug_,
or by _path_ (a post’s URL, relative to the website’s root).

Thus, `[link href="123"]…[/link]`, `[link href="slug-of-post"]…[/link]`, and `[link
href="root-page/sub-page/slug-of-page"]…[/link]` are all equivalent.

These _shortcodes_ are “enclosing” (they wrap the content of the link, just like
HTML tags) and they support the following parameters:

 * `href`: the ID, _slug_, or _path_ of the target post or page;
 * `title`: the title to use in the link, if not set the target post’s title will
   be used;
 * `class`: additional HTML/CSS classes to add to the link;
 * `type`: type of the target post (defaults to “page” for `[page]` and “post” for`[
   link]`).

If no link content to be enclosed is provided, the posts’s title is automatically
used as link text.

## 螢幕擷圖

 * [[
 * _Shortcode_ generation button with file picker.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Simple Stupid Shortcode〉的開發相關工作。

參與者

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

[將〈Simple Stupid Shortcode〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/simple-stupid-shortcode)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/simple-stupid-shortcode/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/simple-stupid-shortcode/)，或
透過 [RSS](https://plugins.trac.wordpress.org/log/simple-stupid-shortcode/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/simple-stupid-shortcode/)。

## 變更記錄

#### 1.5.1

 * Add support for `atts` and `imgatts` attributes for `[image]` shortcodes.

#### 1.5

 * Add support for URLs in `link` attributes for `[image]` shortcodes.

#### 1.4

 * Add [page] and [link] shortcodes.

#### 1.3

 * Added localization support.
 * Updated description and help.

#### 1.2

 * Added “add media” button with file picker on content editor.

#### 1.1

 * Added `didascaly` and `class` parameters.

#### 1.0

 * Initial release.

## 中繼資料

 *  版本 **1.5.1**
 *  最後更新 **8 年前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 4.6 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.9.29**
 *  語言
 * [English (US)](https://wordpress.org/plugins/simple-stupid-shortcode/)
 * 標籤:
 * [embed](https://tw.wordpress.org/plugins/tags/embed/)[image](https://tw.wordpress.org/plugins/tags/image/)
   [media](https://tw.wordpress.org/plugins/tags/media/)[picture](https://tw.wordpress.org/plugins/tags/picture/)
   [shortcode](https://tw.wordpress.org/plugins/tags/shortcode/)
 *  [進階檢視](https://tw.wordpress.org/plugins/simple-stupid-shortcode/advanced/)

## 評分

這個項目尚無任何評論記錄。

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

[查看全部使用者評論](https://wordpress.org/support/plugin/simple-stupid-shortcode/reviews/)

## 參與者

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

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/simple-stupid-shortcode/)