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
2248                /**
2249                 * Filters the WordPress salt.
2250                 *
2251                 * @since 2.5.0
2252                 *
2253                 * @param string $cached_salt Cached salt for the given scheme.
2254                 * @param string $scheme      Authentication scheme. Values include 'auth',
2255                 *                            'secure_auth', 'logged_in', and 'nonce'.
2256                 */
2257                return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2258           }
2259
2260           static $duplicated_keys;
2261           if ( null === $duplicated_keys ) {
2262                $duplicated_keys = array( 'put your unique phrase here' => true );
2263                foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2264                     foreach ( array( 'KEY', 'SALT' ) as $second ) {
2265                          if ( ! defined( "{$first}_{$second}" ) ) {
2266                               continue;
 
Line Code
2303                          update_site_option( 'secret_key', $values['key'] );
2304                     }
2305                }
2306                $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2307           }
2308
2309           $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2310
2311           /** This filter is documented in wp-includes/pluggable.php */
2312           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2313      }
2314 endif;
2315
2316 if ( ! function_exists( 'wp_hash' ) ) :
2317      /**
2318       * Get hash of given string.
2319       *
2320       * @since 2.0.3
2321       *