• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

Widget Work - Part II Consistent Elements


I started working on widgets the other day. A goal for XenWord 3.3 is for the widgets to be consistent in six key areas:
  • Use ob_start()
  • PHP 5.3 hook
  • $fetchOptions and $conditions
  • Views
  • return $instance or 'no form'
  • proper class naming (match file name and class name)
The use of $fetchOptions and $conditions is the most significant change to the code. The first few lines of the Thread.php model shows which elements can be placed in the $fetchOptions and which elements can be placed in the $conditions.

$fetchOptions: join, order, orderDirection, and limit are four key elements.
$conditions: discussion_state, discussion_type, prefix_id, sticky, and deleted are key.

I made it only through two widgets tonight. It was slow going as I was working through the WP_Widget::form() and trying to be consistent on the widgets' backend.

Blog entry information

Last update

More entries in Technology

More entries from LPH