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
1732           /**
1733            * Filter the WordPress salt.
1734            *
1735            * @since 2.5.0
1736            *
1737            * @param string $cached_salt Cached salt for the given scheme.
1738            * @param string $scheme      Authentication scheme. Values include 'auth',
1739            *                            'secure_auth', 'logged_in', and 'nonce'.
1740            */
1741           return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1742      }
1743
1744      static $duplicated_keys;
1745      if ( null === $duplicated_keys ) {
1746           $duplicated_keys = array( 'put your unique phrase here' => true );
1747           foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
1748                foreach ( array( 'KEY', 'SALT' ) as $second ) {
1749                     if ( ! defined( "{$first}_{$second}" ) )
1750                          continue;
 
Line Code
1781                     update_site_option( 'secret_key', $key );
1782                }
1783           }
1784           $salt = hash_hmac( 'md5', $scheme, $key );
1785      }
1786
1787      $cached_salts[ $scheme ] = $key . $salt;
1788
1789      /** This filter is documented in wp-includes/pluggable.php */
1790      return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
1791 }
1792 endif;
1793
1794 if ( !function_exists('wp_hash') ) :
1795 /**
1796  * Get hash of given string.
1797  *
1798  * @since 2.0.3
1799  * @uses wp_salt() Get WordPress salt