Category Archives: English

[Snippet] WordPress: How to use add_meta_box

The add_meta_box() function was introduced in Version 2.5. It allows plugin developers to add meta boxes to the administrative interface.

For example, you want to add a new field for Post such as City. User need to choose City for the post before publish it. We can use add_meta_box to add a new graphical user interface for meta box.


You may add this code snippet in your current active theme functions.php file or create a custom plugin.

Modify the code snippet above as what you need.


Drupal 7 Code Snippet: Alter Captcha Response Text Field

I’m using captcha module to prevent spam on any form of my Drupal site. Captcha module comes with mathematical or images captcha question.

To alter the captcha response text field on drupal 7, you need to write some code on your template.php or create a custom module for it. I only use template.php instead of custom module.

Edit your theme’s template.php file. If the file is not exist, create a new one.

Copy paste this code snippet. Dont forget to modify it 🙂

Drupal 7 – An AJAX HTTP request terminated abnormally [solved]

I tried to update CKEditor module today on my Drupal 7 project, whenever the update is processing, it produces an error. Take a look on error produces below.

Drupal 7 - An AJAX HTTP request terminated abnormally

This is the first time I faces this kind of error. So I write this simple notes for further references. After a few researches, this is how to fix it:

  1. Check .htaccess file, your site redirect from www to non-www or non-www to www
  2. Open settings.php on sites/default and search  Base URL.
  3. If your site is redirected from non-www to www, make sure your base URL in settings.php also using a www url. (e.g:
  4. back to your Drupal admin panel, clear cache and try updating the module again.

Hope it’s working 🙂