Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    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().

    Thread Starter sitesuccess

    (@sitesuccess)

    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

    Plugin Author Jeff Farthing

    (@jfarthing84)

    <td><?php echo wp_editor( $profileuser->description, 'description', array(
        'media_buttons' => false,
        'textarea_rows' => 5
    ) ); ?><br />
    Thread Starter sitesuccess

    (@sitesuccess)

    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

    Plugin Author Jeff Farthing

    (@jfarthing84)

    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"&gt ;This is a link in my bio&lt ;/a>

    Sorry that was supposed to be

    <a href=&quot;http://clickandcreate.us&quot;>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 “&lt ;” and “&gt ;”

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding a visual editor to the bio field’ is closed to new replies.