WordPress.org

Make WordPress Core

Ticket #34889: password.php

File password.php, 497 bytes (added by jperlman, 5 years ago)
Line 
1<?php
2
3require('wp-load.php');
4
5$username = 'demoworking';
6$password = '0987654321';
7
8$user = get_user_by( 'login', $username );
9
10if ( wp_check_password( $password, $user->data->user_pass, $user->ID) )
11    echo 'success';
12else
13    echo 'failure';
14
15
16echo "\n\n\n";
17
18
19$username = 'demofailing';
20$password = '1234567890 ';
21
22$user = get_user_by( 'login', $username );
23
24if( wp_check_password( $password, $user->data->user_pass, $user->ID) )
25    echo 'success';
26else
27    echo 'failure';
28
29
30echo "\n\n\n";