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
2237                /**
2238                 * Filters the WordPress salt.
2239                 *
2240                 * @since 2.5.0
2241                 *
2242                 * @param string $cached_salt Cached salt for the given scheme.
2243                 * @param string $scheme      Authentication scheme. Values include 'auth',
2244                 *                            'secure_auth', 'logged_in', and 'nonce'.
2245                 */
2246                return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2247           }
2248
2249           static $duplicated_keys;
2250           if ( null === $duplicated_keys ) {
2251                $duplicated_keys = array( 'put your unique phrase here' => true );
2252                foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2253                     foreach ( array( 'KEY', 'SALT' ) as $second ) {
2254                          if ( ! defined( "{$first}_{$second}" ) ) {
2255                               continue;
 
Line Code
2292                          update_site_option( 'secret_key', $values['key'] );
2293                     }
2294                }
2295                $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2296           }
2297
2298           $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2299
2300           /** This filter is documented in wp-includes/pluggable.php */
2301           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2302      }
2303 endif;
2304
2305 if ( ! function_exists( 'wp_hash' ) ) :
2306      /**
2307       * Get hash of given string.
2308       *
2309       * @since 2.0.3
2310       *