- add account block

This commit is contained in:
ashubawork
2023-03-29 17:42:53 +03:00
parent a08ed9b6c1
commit c9dedf6d91
6 changed files with 183 additions and 2 deletions
+21
View File
@@ -56,6 +56,14 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
'um-block/um-password-reset' => array(
'render_callback' => array( $this, 'um_password_reset_render' ),
),
'um-block/um-account' => array(
'render_callback' => array( $this, 'um_account_render' ),
'attributes' => array(
'tab' => array(
'type' => 'string',
),
),
),
);
foreach ( $blocks as $k => $block_data ) {
@@ -96,5 +104,18 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
return apply_shortcodes( $shortcode );
}
public function um_account_render( $atts ) {
$shortcode = '[ultimatemember_account';
if ( isset( $atts['tab'] ) && 'all' !== $atts['tab'] ) {
$shortcode .= ' tab="' . $atts['tab'] . '"';
}
$shortcode .= ']';
return apply_shortcodes( $shortcode );
}
}
}