code improvement suggestion
hi, thanks for the nice plugin. I have a suggestion to improve the code a bit. right now it produces lots of php errors when WP_DEBUG is set to true when creating a new widget. not a big deal but for those that have it turned on while doing development, the plugin is unusable.
in function form() instead of using
$instance["title"]a better approach would be something like this:
$title = isset( $instance["title"] ) ? $instance["title"] : '';
! empty()stops the debug errors for unset array elements.
bonus: you can even set defaults if you wanted to.
- The topic ‘code improvement suggestion’ is closed to new replies.