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
1991           /**
1992            * Filters the WordPress salt.
1993            *
1994            * @since 2.5.0
1995            *
1996            * @param string $cached_salt Cached salt for the given scheme.
1997            * @param string $scheme      Authentication scheme. Values include 'auth',
1998            *                            'secure_auth', 'logged_in', and 'nonce'.
1999            */
2000           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2001      }
2002
2003      static $duplicated_keys;
2004      if ( null === $duplicated_keys ) {
2005           $duplicated_keys = array( 'put your unique phrase here' => true );
2006           foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2007                foreach ( array( 'KEY', 'SALT' ) as $second ) {
2008                     if ( ! defined( "{$first}_{$second}" ) ) {
2009                          continue;
 
Line Code
2046                     update_site_option( 'secret_key', $values['key'] );
2047                }
2048           }
2049           $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2050      }
2051
2052      $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2053
2054      /** This filter is documented in wp-includes/pluggable.php */
2055      return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2056 }
2057 endif;
2058
2059 if ( !function_exists('wp_hash') ) :
2060 /**
2061  * Get hash of given string.
2062  *
2063  * @since 2.0.3
2064  *