public function __construct($id = null, $exclude = true) { if ($this->_model === null) { throw new Exception('$this->_model is null'); } $model = $this->_model; $this->_object = new $model($id); parent::__construct($exclude); }
public function isValid(array $values) { $valid = parent::isValid($values); if (!$valid) { return false; } $credentials = $values; $user = wp_authenticate($credentials['user_login'], $credentials['user_password']); if (is_wp_error($user)) { if ($user->get_error_codes() == array('empty_username', 'empty_password')) { $user = new WP_Error('', ''); } return $user; } wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie); do_action('wp_login', $credentials['user_login']); return $user; }
function wpjb_form_render_input(Daq_Form_Abstract $form, Daq_Form_Element $input) { $tag = $form->getRenderer()->renderTag($input); if ($input->hasRenderer()) { $callback = $input->getRenderer(); call_user_func($callback, $input, array("tag" => $tag)); } else { echo $tag; } }