Visual Editor Biography
[resolved] Bio only shows logged in (3 posts)

  1. hauntingreview
    Posted 4 years ago #

    I noticed that the bio only displays when I'm logged into WP but once I'm logged out I can no longer see it.

    This is installed on Multiblog but only enabled for 1 specific blog.

    Any idea what's up?


  2. Matt Wiebe
    Posted 4 years ago #

    Kevin: your plugin is making a faulty assumption, leading to bios only being shown to people logged into the WP install. In the KLVisualBiographyEditor::display_filters(), callback, you're checking for current_user_can('contributor') to use the_content filter on the bio. Problem is, this is not checking if the user whose bio is being displayed is a contributor, but rather, if the person who is currently viewing the site is an editor.

    If you are wanting to make this check, you need to pass the second $user_id parameter from the get_the_author_description filter and check the capability on that user. But I don't think you even need to bother - what does it matter on the display side?

    Finally, you may want to reconsider merely applying the the_content filters. Many plugins add additional content (such as social media buttons) to that filter, which you'll wind up with in this case. It would be better to simply see what the relevant functions running on the_content are, and just running them directly. In this case, wptexturize, convert_chars, and wpautop should do the trick.

  3. Kevin Leary
    Plugin Author

    Posted 4 years ago #

    Thanks for the great suggestions Matt,

    I've taken this into account and have just rolled out a v1.4 update to the plugin that includes the following changes:

    • Switches the current_user_can('contributor') to current_user_can('edit_posts')
    • Remove the display_filters() function altogether to drop that current_user_can('contributor') call, which was definitely a mistake and shouldn't have been in there.
    • Replace the filter call to display_filters() with the 3 filters you suggested: wptexturize(), wpautop() and convert_chars()
    • Added a nice shout out thanking you in the readme.txt Changelog section.

    These updates will fix the issues mentioned above by hauntingreview.

    Also, I wanted to mention that a few months ago I used your handy custom post types class from Somadesign.ca. Thanks for taking the time to put that together, and again for the feedback.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Visual Editor Biography
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic