- foreach($this->selectors as $regex => $funcs) {
- if(preg_match($regex, $path, $matches)) {
- if(isset($funcs[$method])) {
-
- // authenticate regardless of the operation and set the current
- // user. each handler will decide if auth is required or not.
- $this->authenticate();
- $u = wp_get_current_user();
- if(!isset($u) || $u->ID == 0) {
- if ($always_authenticate) {
- $this->auth_required('Credentials required.');
+ foreach ( $this->selectors as $regex => $funcs ) {
+ if ( preg_match($regex, $path, $matches) ) {
+ if ( isset($funcs[$method]) ) {
+
+ // authenticate regardless of the operation and set the current
+ // user. each handler will decide if auth is required or not.
+ if ( !$this->authenticate() ) {
+ if ( $always_authenticate )
+ $this->auth_required('Credentials required.');