[wordpress插件] Code to Widget代码到小部件

wordpress 插件 文章 2020-03-26 18:30 0 15 全屏看文
评分
0
描述

Code to Widget Plugin uses PHP files from a specified directory, and (if the file has the proper template tags) adds a Widget.

小部件插件的代码使用指定目录中的PHP文件,并且(如果该文件具有正确的模板标签)添加小部件。

Details

详细信息

Code to Widget provides an easy way to create widgets, without having to deal with writing the widget class everytime

代码到窗口小部件提供了一种创建窗口小部件的简便方法,而不必每次都要编写窗口小部件类

Configuration

配置

The plugin provides an interface for selecting a specific folder to search for widgets in. The folder path entered into the settings page must be an absolute path.

该插件提供了一个界面,用于选择要在其中搜索小部件的特定文件夹。在设置页面中输入的文件夹路径必须是绝对路径。

Then the widgets are easily configurable similar to all other widgets.

然后,这些小部件就可以像所有其他小部件一样容易地进行配置。

The files in the specified folder need to have specific template tags to be added as widgets.

指定文件夹中的文件需要具有特定的模板标记才能添加为小部件。

The following code will need to be added to the top of the files:

以下代码将需要添加到文件顶部:

  <?php

/*

/ *

Widget Name: Test Widget 1

小部件名称:测试小部件1

Widget Description: Test 1 widget

小部件描述:测试1小部件

*/

* /

?>

?>

A “Widget Title:” field can also be added.

还可以添加“窗口小部件标题:”字段。

That title will be set as the default widget title when the file is selected on the widget settings screen.

在窗口小部件设置屏幕上选择文件时,该标题将被设置为默认窗口小部件标题。

安装步骤

    1. Download the plugin archive and expand it.
    2. 下载插件档案并进行扩展。

    3. Put the code-to-widget directory into your wp-content/plugins/ directory
    4. 将code-to-widget目录放入您的wp-content / plugins /目录

    5. Go to the Plugins page in your WordPress Administration area and click ‘Activate’ for Code to Widget.
    6. 转到WordPress管理区域中的“插件”页面,然后单击“激活”以获取代码到小部件。

    7. Go to the Code to Widget Options page (Settings > Code to Widget) to set the directory for the plugin to search for widgets.

    8. 转到“代码到窗口小部件选项”页面(“设置”>“代码到窗口小部件”),设置插件的目录以搜索窗口小部件。

      The directory to search for widgets must be an absolute path.

      搜索窗口小部件的目录必须是绝对路径。

      There are some helpful paths included on the Settings page.

    9. “设置”页面上包含一些有用的路径。

下载地址
https://downloads.wordpress.org/plugin/code-to-widget.1.2.zip
-EOF-