I find that if I use
class widget_name extends WP_Widget {
function __construct() { ... }
}
instead of
class widget_name extends WP_Widget {
function widget_name() { ... }
}
I get an error like
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /var/www/vhosts/klifmedia.net/httpdocs/jm/km/wp-content/themes/km/functions.php on line 77
Because
widget_name::__construct()
callsWP_Widget::WP_Widget()
, which in turn callswidget_name::__construct()
etc.A simple solution would be to make
widget_name::__construct()
callWP_Widget::__construct()
directly.Also see http://core.trac.wordpress.org/ticket/16768#comment:9