/** * Construct */ function __construct($widget_id = NULL, $args = array(), $default = NULL) { if ($widget_id === NULL) { return false; } $this->id = str_replace(array('_', '-', ' '), '', $widget_id); $this->ctypes = mycred_get_types(); if (!is_array($default)) { $default = array('ctypes' => 'all', 'span' => 0, 'number' => 5); } $this->args = wp_parse_args($args, $default); if ($this->args['ctypes'] == 'all') { $this->core = mycred(); } else { $this->core = mycred($this->args['ctypes']); } $this->colors = mycred_get_type_color(); $this->now = current_time('timestamp'); }
/** * Construct */ function __construct($type = 'mycred_default') { parent::__construct('myCRED_Stats_Module', array('module_name' => 'stats', 'register' => false), $type); $this->label = sprintf('%s %s', mycred_label(), __('Statistics', 'mycred')); $this->colors = mycred_get_type_color(); }