forked from froger-me/wp-remote-users-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
43 lines (34 loc) · 1.1 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
if ( ! defined( 'ABSPATH' ) || ! defined( 'WPINC' ) ) {
exit; // Exit if accessed directly
}
if ( ! function_exists( 'wp_hash_password' ) ) {
/**
* Create a hash (encrypt) of a plain text password.
*
* For integration with other applications, this function can be overwritten to
* instead use the other package password checking algorithm.
*
* @since 2.5.0
*
* @global PasswordHash $wp_hasher PHPass object
*
* @param string $password Plain text user password to hash
* @return string The hash string of the password
*/
function wp_hash_password( $password ) {
global $wp_hasher;
if ( empty( $wp_hasher ) ) {
require_once ABSPATH . WPINC . '/class-phpass.php';
// By default, use the portable hash from phpass
$wp_hasher = new PasswordHash( 8, true ); // @codingStandardsIgnoreLine
}
do_action( 'wprus_password', $password );
return $wp_hasher->HashPassword( trim( $password ) );
}
}
if ( ! function_exists( 'wprus_log' ) ) {
function wprus_log( $expression, $extend = '', $destination = 'error_log' ) {
Wprus_Logger::log( $expression, $extend, $destination );
}
}