From ebc2fc7e0bbda82eeb37b80399ea31c92c34e631 Mon Sep 17 00:00:00 2001 From: jonfalcon Date: Sun, 24 Jan 2016 10:24:19 -0800 Subject: [PATCH] Fix title tags not updated --- core/um-filters-profile.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/core/um-filters-profile.php b/core/um-filters-profile.php index 665e431f..93dc72fc 100644 --- a/core/um-filters-profile.php +++ b/core/um-filters-profile.php @@ -5,18 +5,19 @@ ***/ add_filter('um_profile_tabs', 'um_profile_tabs', 1 ); function um_profile_tabs( $tabs ) { - + $tabs['main'] = array( 'name' => __('About','ultimatemember'), 'icon' => 'um-faicon-user' ); - + return $tabs; } - + /*** *** @dynamic profile page title ***/ + add_filter('wp_title', 'um_dynamic_user_profile_pagetitle', 10, 2 ); add_filter('pre_get_document_title', 'um_dynamic_user_profile_pagetitle', 100000, 2 ); function um_dynamic_user_profile_pagetitle( $title, $sep = '' ) { global $paged, $page, $ultimatemember; @@ -24,27 +25,27 @@ $profile_title = um_get_option('profile_title'); if ( um_is_core_page('user') && um_get_requested_user() ) { - + um_fetch_user( um_get_requested_user() ); - + $profile_title = um_convert_tags( $profile_title ); - + $title = $profile_title; - + um_reset_user(); - + } - + return $title; } - + /*** *** @try and modify the page title in page ***/ add_filter('the_title', 'um_dynamic_user_profile_title', 100000, 2 ); function um_dynamic_user_profile_title( $title, $id = '' ) { global $ultimatemember; - + if( is_admin() ) return $title; @@ -55,6 +56,6 @@ $title = um_get_display_name( get_current_user_id() ); } } - + return (strlen($title)!==strlen(utf8_decode($title))) ? $title : utf8_encode($title); - } \ No newline at end of file + }