- reset password block

This commit is contained in:
ashubawork
2023-03-29 14:38:11 +03:00
parent 61d99135f4
commit a08ed9b6c1
8 changed files with 200 additions and 188 deletions
+31
View File
@@ -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 );
}
}
}