mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +09:00
- add account block
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user