How to restore $args for get_avatar custom “class”?

If you look at the documentation for teh get_avatar() filter, you’ll see that callbacks can accept 6 arguments: apply_filters( ‘get_avatar’, string $avatar, mixed $id_or_email, int $size, string $default, string $alt, array $args ) Which means that your callback function is accepting the arguments correctly, including the 6th argument, $args: function tsm_acf_profile_avatar( $avatar, $id_or_email, $size, $default, … Read more

Cannot get local avatars to show [closed]

Debug ideas: You could try to see if this has any effect: add_filter( ‘bp_core_fetch_avatar_no_grav’, ‘__return_true’ ); But you should check out the parameters that go through the bp_core_fetch_avatar filter to see if they are correct (untested): add_filter( ‘bp_core_fetch_avatar’, ‘my_bp_core_fetch_avatar’, 99, 9 ); function my_bp_core_fetch_avatar( $html, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ) { … Read more

Display avatar of user profile when logged in

Hey pass the current user email id in get_avatar() function if user is logged in like this <?php if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { echo ‘Welcome : ‘ . esc_html( $current_user->display_name ); echo get_avatar( $current_user->ID, 32 ); } }

Uploading avatar from the frontend

You only need to of these hooks show_user_profile to show the extra fields and personal_options_update to update, try: <?php ob_start(); include_once(“../../../wp-load.php”); get_header(); /* Get user info. */ global $current_user, $wp_roles; get_currentuserinfo(); /* Load the registration file. */ require_once( ABSPATH . WPINC . ‘/registration.php’ ); /* If profile was saved, update profile. */ if ( ‘POST’ … Read more

Replace comment avatars and links at the same time

Maybe I was burned out from work before, but this morning I took another go at the same code and managed to get it running properly. if ( ! function_exists( ‘comment_imgs’ ) ) { add_filter( ‘get_comment_author_url’, ‘comment_imgs’ ); function comment_imgs( $avatar, $id_or_email, $size, $default, $alt ) { global $comment; // We do not get the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)