Title: WP Shortcodes API
Author: smccafferty
Published: <strong>2012 年 2 月 1 日</strong>
Last modified: 2012 年 10 月 18 日

---

搜索插件

![](https://ps.w.org/wordpress-shortcodes-api/assets/banner-772x250.png?rev=630313)

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

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

# WP Shortcodes API

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

[下载](https://downloads.wordpress.org/plugin/wordpress-shortcodes-api.0.8.zip)

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

 [支持](https://wordpress.org/support/plugin/wordpress-shortcodes-api/)

## 描述

The plugin take all of the data registered and created a multi-dimensional
 array
in an option called ‘_shortcodes’. Existing shortcodes that WP is away of are also
stored here with just their name and callback.

A few static methods for checking on shortcode info are provided.
 GetShortcodeAtts(
$shortcode_name) ShortcodeInPost($shortcode_name, $post_id)

Creating a new media button in the editor is easy with the `add_media_button()`

method. Just pass your shortcode name, attributes, a page title, introductory text,
and an icon image url.

## 安装

 1. Upload `wp-shortcodes-api.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. example implementation:
 4.     ```
        if (class_exists('WP_Shortcodes_API')) {
                WP_Shortcodes_API::GetInstance()->
                    add_shortcode($shortcode_name, $callback)->
                    add_att($att_name)->
                    add_att($att_name2)->
                    add_media_button(array(
                        'shortcode' => $shortcode_name,
                        'title' => $thickbox_title,
                        'icon_url' => $button_icon_url,
                        'intro' => $introduction_to_form,
                        'input_atts' => WP_Shortcodes_API::GetShortcodeAtts($shortcode_name)
                    ));
            } else {
                // fallback if the plugin is unavailable.
                add_shortcode($shorcode_name, $callback);
            }
        ```
    

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP Shortcodes API」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ smccafferty ](https://profiles.wordpress.org/smccafferty/)
 *   [ markparolisi ](https://profiles.wordpress.org/markparolisi/)
 *   [ voceplatforms ](https://profiles.wordpress.org/voceplatforms/)

[帮助将「WP Shortcodes API」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wordpress-shortcodes-api)

### 对开发感兴趣吗?

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

## 更新日志

#### 0.1

Initial release.

## 额外信息

 *  版本 **0.8**
 *  最后更新：**14 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.0 或更高版本 **
 *  已测试的最高版本为 **3.4.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wordpress-shortcodes-api/)
 * 标签
 * [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/wordpress-shortcodes-api/advanced/)

## 评级

尚未提交反馈。

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

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

## 贡献者

 *   [ smccafferty ](https://profiles.wordpress.org/smccafferty/)
 *   [ markparolisi ](https://profiles.wordpress.org/markparolisi/)
 *   [ voceplatforms ](https://profiles.wordpress.org/voceplatforms/)

## 支持

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

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