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
1796           /**
1797            * Filter the WordPress salt.
1798            *
1799            * @since 2.5.0
1800            *
1801            * @param string $cached_salt Cached salt for the given scheme.
1802            * @param string $scheme      Authentication scheme. Values include 'auth',
1803            *                            'secure_auth', 'logged_in', and 'nonce'.
1804            */
1805           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1806      }
1807
1808      static $duplicated_keys;
1809      if ( null === $duplicated_keys ) {
1810           $duplicated_keys = array( 'put your unique phrase here' => true );
1811           foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
1812                foreach ( array( 'KEY', 'SALT' ) as $second ) {
1813                     if ( ! defined( "{$first}_{$second}" ) ) {
1814                          continue;
 
Line Code
1851                     update_site_option( 'secret_key', $values['key'] );
1852                }
1853           }
1854           $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
1855      }
1856
1857      $cached_salts[ $scheme ] = $values['key'] . $values['salt'];
1858
1859      /** This filter is documented in wp-includes/pluggable.php */
1860      return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1861 }
1862 endif;
1863
1864 if ( !function_exists('wp_hash') ) :
1865 /**
1866  * Get hash of given string.
1867  *
1868  * @since 2.0.3
1869  * @uses wp_salt() Get WordPress salt