Skip to:
Content
Pages
Categories
Search
Top
Bottom

Replace Standard (Text)Buttons with Circle Icons?


  • chrisp333
    Participant

    @chrisp333

    Hi,

    I think I’m quite right here?

    	// Trying to cancel friendship.
    	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) {
    		check_ajax_referer( 'friends_remove_friend' );
    
    		if ( ! friends_remove_friend( bp_loggedin_user_id(), $friend_id ) ) {
    			echo __( 'Friendship could not be canceled.', 'buddypress' );
    		} else {
    			echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
    		}
    
    		// Trying to request friendship.
    	} elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) {
    		check_ajax_referer( 'friends_add_friend' );
    
    		if ( ! friends_add_friend( bp_loggedin_user_id(), $friend_id ) ) {
    			echo __( ' Friendship could not be requested.', 'buddypress' );
    		} else {
    			echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove friendship-button pending_friend requested" rel="remove" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>';
    		}
    
    		// Trying to cancel pending request.
    	} elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) {
    		check_ajax_referer( 'friends_withdraw_friendship' );
    
    		if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) {
    			echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="friendship-button not_friends add" rel="add" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
    		} else {
    			echo __( "Friendship request could not be cancelled.", 'buddypress' );

    I would like to replace all text buttons with matching icons, how does that work? An example of a button here in the code is sufficient for me to understand.

    THANKS

  • You must be logged in to reply to this topic.
Skip to toolbar