My PHP blog

Posts in this section.

WordPress Tips

UTF-8 Slug Issue on WordPress

In the past, my hosting server supports UTF-8 URL, I can use the chinese name as Slug in wordpress. In the past few days, there is a server upgrade, then UTF-8…

Read more
Tips for PHP

PHP Square Bracket Errors

I built a wordpress plug-in. The plug-in is working fine in a server, but another server returned an error about '[. I compared the two servers. Their php is…

Read more
WordPress Tips

The Database Object in WordPress

You can access the database via WordPress. You can use any raw SQL too. That is quite easy. You only need to call a global object; global $wpdb; For the raw…

Read more
Announcements [A]

WordPress Serialize the JSON object

Although WordPress got its own JSON API, you still have your own JSON API for your own plugin and serialize your own data. That is not a problem. WordPress…

Read more
General PHP

WordPress Finally got a REST API

I used Wordpress as the development framework for a mobile application project. Wordpress has a set of XMLPRC api for a very long time. Moreover, the mainstream…

Read more
General PHP

Shortcode in WooCommerce

If you want to have a new custom shortcode in WooCommerce, you can add the codes in wp-content\plug-ins\woocommerce\includes\class-wc-shortcode.php. That will…

Read more
General PHP

Security Tips for Wordpress

I used a lot of free wordpress template and plug-ins. They are good. But in some situations, especially, the templates and plug-ins are not from wordpress.org.…

Read more
Announcements [A]

How to set whether display error in php

By the default, whether the php will display error message is controlled by php.ini. If you are using a shared host, you cannot change it. So, you have to add…

Read more