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
2373                /**
2374                 * Filters the WordPress salt.
2375                 *
2376                 * @since 2.5.0
2377                 *
2378                 * @param string $cached_salt Cached salt for the given scheme.
2379                 * @param string $scheme      Authentication scheme. Values include 'auth',
2380                 *                            'secure_auth', 'logged_in', and 'nonce'.
2381                 */
2382                return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2383           }
2384
2385           static $duplicated_keys;
2386           if ( null === $duplicated_keys ) {
2387                $duplicated_keys = array( 'put your unique phrase here' => true );
2388                foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2389                     foreach ( array( 'KEY', 'SALT' ) as $second ) {
2390                          if ( ! defined( "{$first}_{$second}" ) ) {
2391                               continue;
 
Line Code
2428                          update_site_option( 'secret_key', $values['key'] );
2429                     }
2430                }
2431                $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2432           }
2433
2434           $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2435
2436           /** This filter is documented in wp-includes/pluggable.php */
2437           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2438      }
2439 endif;
2440
2441 if ( ! function_exists( 'wp_hash' ) ) :
2442      /**
2443       * Get hash of given string.
2444       *
2445       * @since 2.0.3
2446       *