Tag

Wordpress

7 posts

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. WordPress is installed on a web server, which either is part of an Internet hosting service or is a network host itself; the first case may be on a service like WordPress.com, for example, and the second case is a computer running the software package WordPress.org. An example of the second case is a local computer configured to act as its own web server hosting Wordpress for single-user testing or learning purposes. Features include a plugin architecture and a template system. WordPress was used by more than 23.3% of the top 10 million websites as of January 2015. WordPress is the most popular blogging system in use on the Web, at more than 60 million websites.

Code

过期的 mysql_escape_string 在 WordPress 下的解决办法

对 string 稍作处理, 避免在写 query 的时候被 SQL 注入, 这是常识. 我们若变更 PHP 版本, 有时候会出现 Call To Undefined Function 这样的错误. 很多时候, 我们需要做出一些兼容性的处理.

不过, 若我们是在 WordPress 的平台上写插件, 则不必这么麻烦了.

Code

评论框添加 Ctrl+Enter 即发送

这东西可以通过修改 theme 的 comment.php (路径: Appearance->Editor->Comments(或者其他类似的))来达到目标。

基本原理是这篇文字的内容。

问题是,现在 WP 的评论框非常之省事:

Code

做个插入维基词条的插件

常常使用到各种术语什么的,一个一个解释,其实也就是copy Wikipedia词条上的东西,费时费力不讨好,还不如直接挂个链接完事,但是每次添加链接都是个悲剧的事情,各种数据添加的人都要疯掉了。