Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: salt

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

This hook occurs 2 times in this file.

Line Code
2281                /**
2282                 * Filters the WordPress salt.
2283                 *
2284                 * @since 2.5.0
2285                 *
2286                 * @param string $cached_salt Cached salt for the given scheme.
2287                 * @param string $scheme      Authentication scheme. Values include 'auth',
2288                 *                            'secure_auth', 'logged_in', and 'nonce'.
2289                 */
2290                return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2291           }
2292
2293           static $duplicated_keys;
2294           if ( null === $duplicated_keys ) {
2295                $duplicated_keys = array( 'put your unique phrase here' => true );
2296                foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2297                     foreach ( array( 'KEY', 'SALT' ) as $second ) {
2298                          if ( ! defined( "{$first}_{$second}" ) ) {
2299                               continue;
 
Line Code
2336                          update_site_option( 'secret_key', $values['key'] );
2337                     }
2338                }
2339                $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2340           }
2341
2342           $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2343
2344           /** This filter is documented in wp-includes/pluggable.php */
2345           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2346      }
2347 endif;
2348
2349 if ( ! function_exists( 'wp_hash' ) ) :
2350      /**
2351       * Get hash of given string.
2352       *
2353       * @since 2.0.3
2354       *