Notifications
Clear all

Script [Solved] Remove Parenthesis Around Profile Nicename

6 Posts
2 Users
1 Reactions
1,096 Views
Posts: 48
Topic starter
(@curtisb)
Trusted Member
Joined: 7 years ago

Is there any fancy css I can use to hide the parenthesis ( ) around the Nicename under a user's profile? (I just think it will look cleaner and will be easier to read)

such as using ::first-letter and ::last-letter.

I tried different combinations and never seemed to get the right combination of selector and ::xx-letter.

Thanks!

 

5 Replies
Robert
Posts: 10549
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @curtisb,

I'm sorry but that's not possible. We'll add a filter hook in next version to allow you filter and remove unnecessary characters.

2 Replies
(@curtisb)
Joined: 7 years ago

Trusted Member
Posts: 48

Thank's @Robert!

I appreciate you considering adding this filter for me and anyone else interested in doing the same thing.

 

 

(@curtisb)
Joined: 7 years ago

Trusted Member
Posts: 48

@robert 

Can you share with me how to do this?

I have the "Code Snippets" plugin, is there a line or two of code I can add to it?

Robert
Posts: 10549
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @curtisb,

Let's try this. Put this code in a PHP snippets using Code Snippets plugin or in the functions.php file of your current active WordPress theme, delete all caches and check it:

add_filter( 'wpforo_member_nicename', function($nicename){
return str_replace(array('(', ')'), '', $nicename);
});

 

1 Reply
(@curtisb)
Joined: 7 years ago

Trusted Member
Posts: 48

@robert 

That worked perfectly! Thank you!

I like the results. Cleaner. Easier to read, easier to copy/paste the nicename when needed for specific @mentions in posts.