Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • marcelokayata
    Participant

    @marcelokayata

    This is the code in bp-custom which it’s not working

    <?php
    //marcelokayata
    define( ‘BP_MESSAGES_AUTOCOMPLETE_ALL’, true );
    //—————————————————–
    // Add Shortcode
    function teste_avatar_shortcode() {

    ob_start();

    global $post;

    $current_user = wp_get_current_user();
    /*echo ‘Username: ‘ . $current_user->user_login . ‘<br />’;
    echo ‘User email: ‘ . $current_user->user_email . ‘<br />’;
    echo ‘User first name: ‘ . $current_user->user_firstname . ‘<br />’;
    echo ‘User last name: ‘ . $current_user->user_lastname . ‘<br />’;
    echo ‘User display name: ‘ . $current_user->display_name . ‘<br />’;
    echo ‘User ID: ‘ . $current_user->ID . ‘<br />’;*/

    if($current_user->ID!=0){

    echo get_avatar_url($current_user->ID);
    echo get_avatar($current_user->ID);

    }

    $output = ob_get_contents();
    ob_end_clean();
    return $output;

    }
    add_shortcode( ‘teste_avatar’, ‘teste_avatar_shortcode’ );

Viewing 1 replies (of 1 total)
Skip to toolbar