Add dashboard logo

This commit is contained in:
Hoang Huu 2019-09-25 15:48:34 +07:00
parent f5f29f508c
commit f7efadf4aa
2 changed files with 41 additions and 14 deletions

View File

@ -46,7 +46,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'before_row' => '<hr>',
'after_row' => '<hr>',
],
[
'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
@ -54,6 +53,23 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'type' => 'select',
'options' => $pages,
],
[
'name' => esc_html__( 'Dashboard Logo', 'opalestate-pro' ),
'desc' => esc_html__( 'Upload a logo for user dashboard page.', 'opalestate-pro' ),
'id' => 'dashboard_logo',
'type' => 'file',
'preview_size' => [ 100, 100 ],
'options' => [
'url' => false,
],
'query_args' => [
'type' => [
'image/gif',
'image/jpeg',
'image/png',
],
],
],
[
'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page use User login and register an account, or reset password.', 'opalestate-pro' ),

View File

@ -70,21 +70,32 @@ if ( $current_user->display_name !== $current_user->user_login ) {
<div class="opal-row-inner">
<div class=" user-dasboard-sidebar">
<div class="navbar-brand">
<?php if ( ! has_custom_logo() ) { ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand mb-0">
<a rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" itemprop="url">
<?php bloginfo( 'name' ); ?>
</a>
</h1>
<?php if ( $dashboard_logo_id = opalestate_get_option( 'dashboard_logo_id' ) ) : ?>
<?php
printf(
'<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image( $dashboard_logo_id, 'full' )
);
?>
<?php else : ?>
<a class="navbar-brand" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" itemprop="url">
<?php bloginfo( 'name' ); ?>
</a>
<?php if ( ! has_custom_logo() ) : ?>
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="navbar-brand mb-0">
<a rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" itemprop="url">
<?php bloginfo( 'name' ); ?>
</a>
</h1>
<?php else : ?>
<a class="navbar-brand" rel="home" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
itemprop="url">
<?php bloginfo( 'name' ); ?>
</a>
<?php endif; ?>
<?php else :
the_custom_logo();
endif; ?><!-- end custom logo -->
<?php endif; ?>
<?php } else {
the_custom_logo();
} ?><!-- end custom logo -->
</div>
<div class="user-dasboard-sidebar-inner">