Forum Replies Created
-
In reply to: Allowing inline images uploads in posts?
Hello Ben,
Add this function to your functions.php file:
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;
}This adds an “Add media” button to the write panel.
In reply to: Allowing inline images uploads in posts?You can add the following code in your functions.php file:
add_action(‘media_buttons’, ‘ml_pre_media_buttons’, 1);
add_action(‘media_buttons’, ‘ml_post_media_buttons’, 20);
function ml_pre_media_buttons($editor_id) {
if (!$editor_id == ‘bbp_reply_content’)
return;$GLOBALS[‘post_temp’] = $GLOBALS[‘post’];
$GLOBALS[‘post’] = null;
}
function ml_post_media_buttons($editor_id) {
if (!$editor_id == ‘bbp_reply_content’)
return;$GLOBALS[‘post’] = $GLOBALS[‘post_temp’];
}In reply to: Allow Participant Role To Upload ImageHello,
Here is your solution:
Add the following to functions.php file in your child theme:add_action(‘media_buttons’, ‘ml_pre_media_buttons’, 1);
add_action(‘media_buttons’, ‘ml_post_media_buttons’, 20);
function ml_pre_media_buttons($editor_id) {
if (!$editor_id == ‘bbp_reply_content’)
return;$GLOBALS[‘post_temp’] = $GLOBALS[‘post’];
$GLOBALS[‘post’] = null;
}
function ml_post_media_buttons($editor_id) {
if (!$editor_id == ‘bbp_reply_content’)
return;$GLOBALS[‘post’] = $GLOBALS[‘post_temp’];
}Reference: https://bbpress.org/forums/topic/solved-only-keymasters-admin-can-upload-images/