WordPress插件开发笔记(一):主文件申明

2018-10-27  本文已影响19人  破旧的大卡车

这是我开发插件LaTeX2HTML的学习笔记.

首先, 一个标准的插件, 至少需要以下

此外, 还有一些文件, 我们将在后续讲解:

下面, 我们就开始编辑主文件latex2html/latex2html.php, 主文件应该首先申明插件的基本信息:

<?php
/*
Plugin Name: LaTeX2HTML
Plugin URI:  https://latex2html.vanabel.cn
Description: Translate your LaTeX doc, mainly with <em>amsart</em> as documentclass, to HTML+MathJax.
Version:     1.2.4
Author:      Van Abel
Author URI:  https://vanabel.cn
Text Domain: val2h
Domain Path: /languages
License:     GPL2
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with This program. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
*/

现在, 如果你将latex2html文件夹放到WP的wp-content/plugins目录下, 则可在WP的插件页看到我们的新插件.

LaTeX2HTML Preview

附注: 我是使用 usbwebserver 来搭建本地WP环境的. 安装后只需将WP压缩包解压到usbwebserver的root目录. 然后访问http://localhost:8080/wordpress即可安装WP.

上一篇 下一篇

猜你喜欢

热点阅读