Then, code the MyPlugin class, as shown in Listing 13.
接下来,编写 MyPlugin类的代码,如 清单13所示。
For example, if the plug-in directory is called myplugin, name the file myplugin.php.
例如,如果插件目录的名称是myplugin,那么此文件就应该命名为myplugin . php。
When the Web application starts, it displays a message saying "MyPlugin starting" and sets the system's proxy and port.
当启动Web应用程序时,会显示一条消息说“MyPlugin starting”,并设置系统的proxy 和 port 属性。
After creating the project, the directory listing of the your WordPress_home/wp-content/plugins/myplugin directory will look like Listing 1.
创建项目后,WordPress_home/wp-content/plugins/myplugin目录的目录列表应类似清单1。
By specifying act=myPlugin/myReports, index.php sees that it is a path name and therefore recognizes that you are loading a plug-in instead of a regular module.
通过指定act=myPlugin/myReports,index.php 就知道这是一个路径名,从而意识到正在加载的是插件而不是模块。
Then browse to or type the name of the directory that you just created (for example, my directory is /Users/ngood/Sites/blog/wp-content/plugins/myplugin) in the Directory box, as Figure 2 shows.
接下来浏览或在Directory框中键入刚刚创建的目录的名称(例如,我的目录是 /Users/ngood/Sites/blog/wp-content/plugins/myplugin),如图 2 所示。
Then browse to or type the name of the directory that you just created (for example, my directory is /Users/ngood/Sites/blog/wp-content/plugins/myplugin) in the Directory box, as Figure 2 shows.
接下来浏览或在Directory框中键入刚刚创建的目录的名称(例如,我的目录是 /Users/ngood/Sites/blog/wp-content/plugins/myplugin),如图 2 所示。
应用推荐