Entries filed under Tips & Tutorials

jQuery in Widgets Admin Page

Posted on 2012/01/18 Comments

Here’s a quick tip. If you built a custom widget for your themes/plugins and you need jQuery for the configuration form, you’ll need to call it when the ajax process is done, that is when a widget was just dropped to a sidebar/widget area, or the user just saved the configuration.

jQuery(document).ready(function($) {
  $('.widgets-sortables').ajaxSuccess(function() {
    // do your thing
  });
});

Hacking Term List Table

Posted on 2012/01/11 Comments

Term list table, unlike post list table, is not very customizable. What I needed was to display the thumbnail/icon of each term, to make it easier for the content editors to distinguish one term from another.

Continue…

Setting Default File Permission in Linux™

Posted on 2012/01/08 Comments

Here’s the situation; I want every newly created file/directory in /var/www to be owned by user kucrut and group apache, and they should have read/write permissions, while all other users/groups should only have read permission. We will use ACL for this, and it’s usually installed by default. Continue…

Customize post type archive order

Posted on 2012/01/03 Comments

By now you’re probably already familiar with one of WordPress’ most loved features, custom post type. A custom post type could be hierarchical (like page) or non-hierarchical (like post). This snippet will modify the default posts order when the post type archive is being displayed. Continue…