mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
- reset password block
This commit is contained in:
@@ -45,6 +45,17 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
|
||||
),
|
||||
),
|
||||
),
|
||||
'um-block/um-forms' => array(
|
||||
'render_callback' => array( $this, 'um_forms_render' ),
|
||||
'attributes' => array(
|
||||
'form_id' => array(
|
||||
'type' => 'string',
|
||||
),
|
||||
),
|
||||
),
|
||||
'um-block/um-password-reset' => array(
|
||||
'render_callback' => array( $this, 'um_password_reset_render' ),
|
||||
),
|
||||
);
|
||||
|
||||
foreach ( $blocks as $k => $block_data ) {
|
||||
@@ -65,5 +76,25 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
|
||||
|
||||
return apply_shortcodes( $shortcode );
|
||||
}
|
||||
|
||||
|
||||
public function um_forms_render( $atts ) {
|
||||
$shortcode = '[ultimatemember';
|
||||
|
||||
if ( isset( $atts['form_id'] ) && '' !== $atts['form_id'] ) {
|
||||
$shortcode .= ' form_id="' . $atts['form_id'] . '"';
|
||||
}
|
||||
|
||||
$shortcode .= ']';
|
||||
|
||||
return apply_shortcodes( $shortcode );
|
||||
}
|
||||
|
||||
|
||||
public function um_password_reset_render() {
|
||||
$shortcode = '[ultimatemember_password]';
|
||||
|
||||
return apply_shortcodes( $shortcode );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user