Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_authentication_errors

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
126            * match the format used by API methods internally (that is, the `status`
127            * data should be used). A callback can return `true` to indicate that
128            * the authentication method was used, and it succeeded.
129            *
130            * @since 4.4.0
131            *
132            * @param WP_Error|null|bool WP_Error if authentication error, null if authentication
133            *                              method wasn't used, true if authentication succeeded.
134            */
135           return apply_filters( 'rest_authentication_errors', null );
136      }
137
138      /**
139       * Converts an error to a response object.
140       *
141       * This iterates over all error codes and messages to change it into a flat
142       * array. This enables simpler client behaviour, as it is represented as a
143       * list in JSON rather than an object/map.
144       *