Skip to content

Commit

Permalink
Account page title changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdev10 committed Oct 13, 2020
1 parent 9845eeb commit a85d81f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 5 additions & 0 deletions includes/helpers/misc.php
Expand Up @@ -568,8 +568,13 @@ function uwp_always_nav_menu_visibility( $result, $option, $user )
* @return string Title.
*/
function uwp_account_privacy_page_title($title, $type) {

if ($type == 'privacy') {
$title = __( 'Privacy', 'userswp' );
} elseif ($type == 'notifications') {
$title = __( 'E-Mail Notifications', 'userswp' );
} elseif ($type == 'delete-account') {
$title = __( 'Delete Account', 'userswp' );
}

return $title;
Expand Down
23 changes: 17 additions & 6 deletions templates/bootstrap/account.php
Expand Up @@ -18,9 +18,20 @@
<div class="d-flex justify-content-center flex-column align-items-center">
<?php
echo do_shortcode('[uwp_user_avatar size=150 allow_change=1]');
do_action( 'uwp_template_form_title_before', 'account' ); ?>
<a href="<?php echo uwp_build_profile_tab_url($user_id); ?>" class="mt-0 text-decoration-none font-weight-bold"> @<?php echo $display_name; ?></a>
<?php do_action( 'uwp_template_form_title_after', 'account' ); ?>

do_action( 'uwp_template_form_title_before', 'account' );

echo aui()->button( array(
'type' => 'a',
'href' => uwp_build_profile_tab_url($user_id),
'class' => 'mt-0 text-decoration-none font-weight-bold',
'icon' => '',
'title' => $display_name,
'content' => '@'.$display_name,
));

do_action( 'uwp_template_form_title_after', 'account' );
?>
</div>
<div class="d-flex justify-content-center nav mt-0">
<?php do_action( 'uwp_account_menu_display' ); ?>
Expand All @@ -31,15 +42,15 @@
<div class="col-lg-9">
<div class="pl-lg-4 pl-sm-0 h-100 pt-5 pb-lg-0 pb-3">
<?php
$form_title = ! empty( $args['form_title'] ) ? esc_attr__( $args['form_title'], 'userswp' ) : __( 'Edit Account', 'userswp' );

if ( isset( $_GET['type'] ) ) {
if ( isset( $_GET['type'] ) ) {
$type = strip_tags( esc_sql( $_GET['type'] ) );
} else {
$type = 'account';
}

$form_title = ! empty( $args['form_title'] ) ? esc_attr__( $args['form_title'], 'userswp' ) : __( 'Edit Account', 'userswp' );
$form_title = apply_filters( 'uwp_template_form_title', $form_title, 'account' );
$form_title = apply_filters( 'uwp_account_page_title', $form_title, $type );
if ( $form_title != '0' ) {
echo '<h3 class="mb-lg-5 mb-4">';
echo $form_title;
Expand Down

0 comments on commit a85d81f

Please sign in to comment.