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
2582                /**
2583                 * Filters the WordPress salt.
2584                 *
2585                 * @since 2.5.0
2586                 *
2587                 * @param string $cached_salt Cached salt for the given scheme.
2588                 * @param string $scheme      Authentication scheme. Values include 'auth',
2589                 *                            'secure_auth', 'logged_in', and 'nonce'.
2590                 */
2591                return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2592           }
2593
2594           static $duplicated_keys;
2595           if ( null === $duplicated_keys ) {
2596                $duplicated_keys = array();
2597
2598                foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
2599                     foreach ( array( 'KEY', 'SALT' ) as $second ) {
2600                          if ( ! defined( "{$first}_{$second}" ) ) {
 
Line Code
2682                          update_site_option( 'secret_key', $values['key'] );
2683                     }
2684                }
2685                $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
2686           }
2687
2688           $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
2689
2690           /** This filter is documented in wp-includes/pluggable.php */
2691           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
2692      }
2693 endif;
2694
2695 if ( ! function_exists( 'wp_hash' ) ) :
2696      /**
2697       * Gets the hash of the given string.
2698       *
2699       * The default algorithm is md5 but can be changed to any algorithm supported by
2700       * `hash_hmac()`. Use the `hash_hmac_algos()` function to check the supported