[wordpress插件] CC-IMG-ShortcodeCC-IMG-短代码

wordpress 插件 文章 2020-03-19 14:00 434 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin adds the [img] shortcode which replaces the html tag.

此插件添加了 [img] 短代码,该短代码取代了 html标签。

It’s also enables adding new media to post/page via the ‘Add media’ button by automatically inserting the formatted shortcode code to the editor.

通过自动将格式化的短代码插入到编辑器中,还可以通过“添加媒体”按钮将新媒体添加到帖子/页面中。

You can simply add the [img] shortcode with a media ID to display:

您只需添加带有媒体ID的 [img] 短代码即可显示:

[img 123]

  [img 123]

or a fully formatted [img] shortcode:

或完全格式化的 [img] 简码:

[img 123 align="center" size="full" caption="Sample text" title="Sample text" desc="Sample text" alt="Sample text" url="http://

  [img 123 align =“ center” size =“ full” caption =“示例文本” title =“示例文本” desc =“示例文本” alt =“示例文本” url =“ http:// 

example.com/"]

example.com/“]

It’s supports srcset and sizes parameters.

它支持 srcset sizes 参数。

Tips & Tricks

提示和技巧

You can use your own html template file for displaying the img tag by using filter:

您可以使用自己的HTML模板文件通过使用过滤器来显示 img 标记:

add_filter( 'Clearcode\IMG_Shortcode\template', function() { return '/themes/clearcode.cc/templates/img.php'; } );

  add_filter('Clearcode \ IMG_Shortcode \ template',function(){return'/themes/clearcode.cc/templates/img.php';});

安装步骤

From your WordPress Dashboard

从您的WordPress仪表板中

    1. Go to ‘Plugins > Add New’
    2. 转到“插件>添加新内容”

    3. Search for ‘CC-IMG-Shortcode’
    4. 搜索“ CC-IMG-短代码”

    5. Activate the plugin from the Plugin section on your WordPress Dashboard.
    6. 从WordPress仪表板上的“插件”部分激活插件。

    From WordPress.org

    来自WordPress.org

      1. Download ‘CC-IMG-Shortcode’.
      2. 下载“ CC-IMG-Shortcode”。

      3. Upload the ‘CC-IMG-Shortcode’ directory to your ‘/wp-content/plugins/’ directory using your favorite method (ftp, sftp, scp, etc…)
      4. 使用您喜欢的方法(ftp,sftp,scp等)将“ CC-IMG-Shortcode”目录上传到您的“ / wp-content / plugins /”目录

      5. Activate the plugin from the Plugin section in your WordPress Dashboard.
      6. 从WordPress信息中心的“插件”部分激活插件。

      Once Activated

      一旦激活

        1. Simply add new media to post/page via ‘Add media’ button in your post/page edit page.
        2. 只需通过帖子/页面编辑页面中的“添加媒体”按钮将新媒体添加到帖子/页面即可。

        Multisite

        多站点

        The plugin can be activated and used for just about any use case.

        可以激活该插件并将其用于几乎所有用例。

          • Activate at the site level to load the plugin on that site only.
          • 在站点级别激活以仅在该站点上加载插件。

          • Activate at the network level for full integration with all sites in your network (this is the most common type of multisite installation).
          • 在网络级别激活以与网络中的所有站点完全集成(这是多站点安装的最常见类型)。

下载地址
https://downloads.wordpress.org/plugin/cc-img-shortcode.zip
-EOF-

AI助手支持GPT4.0