Adding custom class to get_avatar() image doesn&https://wordpress.stackexchange.com/https://wordpress.stackexchange.com/#39;t work

The following worked for me: <?php echo get_avatar( $comment, 60, ”, ”, $args = array( ‘scheme’ => ‘https’, ‘class’ => ‘myclass’ ) ); ?> Your use of $args[‘avatar_size’] should be an int and you may have confused the use of this parameter (unless you have a variable $args, and it is an array).

Adding number to date not working [closed]

your code is not working, because you use strtotime incorrectly… It should be used like this: int strtotime ( string $time [, int $now ] ) But you pass formatted dated as first param, and another string as second one. So how should it look like? Like so: $addeddays = intval( get_user_meta($this->order->user_id, ‘xxx’, true) ); … Read more

Modifying Author Link to add Author Meta in URL

I don’t know the context, but i got your use case working like this: Add new permastruct and make sure to regenerate permalinks (Settings > Permalinks > Save) /** * Add additional permalink * * @uses https://codex.wordpress.org/Plugin_API/Action_Reference/init */ function wpte_add_permastruct(){ add_permastruct( ‘%author_trip_vendor%’, ‘operator/%author%’, [ ‘ep_mask’ => EP_AUTHORS, ]); } add_action( ‘init’, ‘wpte_add_permastruct’ ); Added this … Read more

Can I set user meta for theoretical user 0?

It turns out (via comments) that (ab)using user 0 is a really bad idea. However, WordPress is built to allow new things to get meta-tables. Which led me to make Guest Meta as a plugin. It’s available on GitHub as a gist and below in its current form. I have to point out that this … Read more

Assign a role to the user who registers on a form

$POST = filter_var_array($_POST, FILTER_SANITIZE_STRING); $nome = $POST[‘nome’]; $cognome = $POST[‘cognome’]; $email = $POST[’email’]; $token = $POST[‘stripeToken’]; $nickname = $nome . ‘ ‘ . $cognome; // Inserisce utente nel DB $user_data = [ ‘user_login’ => $nickname, ‘user_pass’ => wp_generate_password (), ‘user_email’ => $email, ]; $user_id = wp_insert_user($user_data); update_user_meta( $user_id, ‘first_name’, $nome); update_user_meta( $user_id, ‘last_name’, $cognome); update_user_meta( … Read more

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