There are probably a few ways to go about it. The simplest would be to copy the profile-form.php
into your current theme’s directory and replace the textarea with a call to wp_editor()
.
As I’m not a programmer, can you please add the correct syntax to replace
<td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html( $profileuser->description ); ?></textarea><br />
Thanks
<td><?php echo wp_editor( $profileuser->description, 'description', array(
'media_buttons' => false,
'textarea_rows' => 5
) ); ?><br />
Thanks, works like a charm.
One last thing if I may: how can I set it to not show the visual editor to specific roles? (subscriber, customer)
I want to show them the regular textarea
Thanks again, I love using your plugin
Check a permission higher than they should have and wrap the above code in that check:
<?php if ( current_user_can( 'edit_posts' ) ) : ?>
<td><?php echo wp_editor( $profileuser->description, 'description', array(
'media_buttons' => false,
'textarea_rows' => 5
) ); ?><br />
<?php else : ?>
<td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html( $profileuser->description ); ?></textarea><br />
<?php endif; ?>
Thanks for this. I needed this for my client’s site too. One issue I’m running into, however, is how it’s saving links. My client wanted this so that users could put links in their profiles, but when I try to do that in the bio editor on the /your-profile page, it saves the link as
<a href="http://clickandcreate.us"> ;This is a link in my bio< ;/a>
Sorry that was supposed to be
<a href="http://clickandcreate.us">This is a link in my bio</a>
That is how what is supposed to be a link ends up displaying, because the tag brackets get encoded as “< ;” and “> ;”