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
1959           /**
1960            * Filters the WordPress salt.
1961            *
1962            * @since 2.5.0
1963            *
1964            * @param string $cached_salt Cached salt for the given scheme.
1965            * @param string $scheme      Authentication scheme. Values include 'auth',
1966            *                            'secure_auth', 'logged_in', and 'nonce'.
1967            */
1968           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1969      }
1970
1971      static $duplicated_keys;
1972      if ( null === $duplicated_keys ) {
1973           $duplicated_keys = array( 'put your unique phrase here' => true );
1974           foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
1975                foreach ( array( 'KEY', 'SALT' ) as $second ) {
1976                     if ( ! defined( "{$first}_{$second}" ) ) {
1977                          continue;
 
Line Code
2014                     update_site_option( 'secret_key', $values['key'] );
2015                }
2016           }
2017           $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2018      }
2019
2020      $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2021
2022      /** This filter is documented in wp-includes/pluggable.php */
2023      return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2024 }
2025 endif;
2026
2027 if ( !function_exists('wp_hash') ) :
2028 /**
2029  * Get hash of given string.
2030  *
2031  * @since 2.0.3
2032  *