ld_reset_password.php
1.3 KB
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
44
45
46
47
48
49
50
51
<?php
/**
* LearnDash `[ld_reset_password]` shortcode processing.
*
* @since 4.4.0
* @package LearnDash\Shortcodes
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Builds the `[ld_reset_password]` shortcode output.
*
* @global boolean $learndash_shortcode_used
*
* @since 4.4.0
*
* @param array $attr {
* An array of shortcode attributes.
*
* @type string $width Width of the reset password form. Default empty.
* }.
* @param string $content The shortcode content. Default empty.
* @param string $shortcode_slug The shortcode slug. Default 'ld_reset_password'.
*
* @return string The `ld_reset_password` shortcode output.
*/
function learndash_reset_password( $attr = array(), $content = '', $shortcode_slug = 'ld_reset_password' ) {
global $learndash_shortcode_used;
$learndash_shortcode_used = true;
if ( ! is_array( $attr ) ) {
$attr = array();
}
$attr = shortcode_atts(
array(
'width' => '',
),
$attr
);
/** This filter is documented in includes/shortcodes/ld_course_resume.php */
$attr = apply_filters( 'learndash_shortcode_atts', $attr, $shortcode_slug );
$level = ob_get_level();
ob_start();
learndash_reset_password_output( $attr );
$content .= learndash_ob_get_clean( $level );
return $content;
}
add_shortcode( 'ld_reset_password', 'learndash_reset_password' );