From 41c7a4b72165baad6d3f80621320fa22663699e8 Mon Sep 17 00:00:00 2001 From: VladyslavaTokar Date: Tue, 7 Sep 2021 17:03:35 +0200 Subject: [PATCH] added user profile menu item function --- author.php | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/author.php b/author.php index 85cd061..a95aa0e 100755 --- a/author.php +++ b/author.php @@ -7,17 +7,36 @@ * @package Listify */ -get_header(); +get_header(); include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); ?> - + + + +nickname; + +//create link to user page +$homelink = '
  • ' . __('Profile') . '
  • '; +$items = $homelink . $items; + +return $items; +} +add_filter( 'wp_nav_menu_items', 'new_nav_menu_items', 10, 2 ); +?> +
    >
    -

    - first_name ) && !empty( $current_user->last_name ) ){ echo "User Profile: " . $current_user->first_name . ' ' . $current_user->last_name; - } + } //Else, display name else{ echo "User Profile: " . $current_user->display_name; }?> - +

    @@ -76,7 +95,7 @@ //If Restrict Content Pro plugin is activated, we display the user subscription if ( is_plugin_active( 'restrict-content-pro/restrict-content-pro.php' ) && rcp_get_subscription( get_queried_object_id() ) != null ){ echo rcp_get_subscription( get_queried_object_id() ); - } + } //If not, we display the WP roles else{ echo implode( ', ', $user_data->roles ); @@ -90,7 +109,7 @@
      - ID ) && get_the_author_meta( 'year_of_birth', $current_user->ID ) != 'none' ){ ?>
    • @@ -122,7 +141,7 @@ if( !empty( get_the_author_meta( 'primary_degree', $current_user->ID ) ) ){ ?>
    • - ID ); //Secondary degree @@ -169,7 +188,7 @@ //If Restrict Content Pro plugin is activated, we display the user subscription if ( is_plugin_active( 'restrict-content-pro/restrict-content-pro.php' ) ){ echo rcp_get_subscription( get_queried_object_id() ); - } + } //If not, we display the WP roles else{ echo implode( ', ', $user_data->roles ); @@ -177,7 +196,7 @@ ?>
    • - ID ) && get_the_author_meta( 'year_of_birth', $current_user->ID ) != 'none' ){ ?>
    • @@ -209,7 +228,7 @@ if( !empty( get_the_author_meta( 'primary_degree', $current_user->ID ) ) ){ ?>
    • - ID ); //Secondary degree @@ -275,7 +294,7 @@ Pinterest'; ?>
    • -
    • @@ -311,7 +330,7 @@ - $current_user->ID] ); @@ -370,7 +389,7 @@ ?>
    - +