Attempted add to functions.php and locked out of wordpress by blank page
-
I attempted to change Howdy to Welcome by putting the following code into function.php file.
On save, I received a blank page and now cannot access the www.ads-software.com account or the site itself from outside.
Very embarrassing!01 add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_custom_account_menu’, 11 );
02
03 function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
04 $user_id = get_current_user_id();
05 $current_user = wp_get_current_user();
06 $profile_url = get_edit_profile_url( $user_id );
07
08 if ( 0 != $user_id ) {
09 /* Add the “My Account” menu */
10 $avatar = get_avatar( $user_id, 28 );
11 $howdy = sprintf( __(‘Welcome, %1$s’), $current_user->display_name );
12 $class = empty( $avatar ) ? ” : ‘with-avatar’;
13
14 $wp_admin_bar->add_menu( array(
15 ‘id’ => ‘my-account’,
16 ‘parent’ => ‘top-secondary’,
17 ‘title’ => $howdy . $avatar,
18 ‘href’ => $profile_url,
19 ‘meta’ => array(
20 ‘class’ => $class,
21 ),
22 ) );
23
24 }
25 }
- The topic ‘Attempted add to functions.php and locked out of wordpress by blank page’ is closed to new replies.