Add Media Upload Button to bbPress

media-upload-bbpress
As a moderator in bbPress, you sometimes need to upload an image in order to better explain a solution. In the past I uploaded the image using the Media uploader, copied the URL and then pasted it into the discussion. Not the most efficient way of doing things.
After a little bit of research, I discovered that I can easily add a media upload button to make the whole process a lot more streamlined.
Open up your functions.php file and add the following snippet to get it working:

add_filter( 'bbp_after_get_the_content_parse_args', 'bavotasan_bbpress_upload_media' );
/**
 * Allow upload media in bbPress
 *
 * This function is attached to the 'bbp_after_get_the_content_parse_args' filter hook.
 */
function bavotasan_bbpress_upload_media( $args ) {
	$args['media_buttons'] = true;
	return $args;
}

With this snippet in place, moderators will now have the ability to upload using the built-in media uploader. There may be a way to also allow regular users to have access to the button but I haven’t delved deeper into that since I didn’t require that option.

Share this:

Email
Facebook
Twitter
Pinterest
Pocket

Premium Themes for WordPress

Looking for an easy-to-use Premium Theme for WordPress? Check out Themes by bavotasan.com and have your site up and running in no time.

Use this WordPress website builder to build powerful websites in no time for your or your clients.

WordPress Hosting

WP Engine – designed from the ground-up to support and enhance the workflow of web designers.

Bluehost – providing quality web hosting solutions since 1996.

About the author

Picture of Luke Perrie

Luke Perrie