Modifying the BuddyPages editor

How to modify the wp_editor instance for BuddyPages. You will need to be familiar with how WordPress filters work.

Default values

/**
 * Filters wp_editor args for BuddyPages content editor.
 *
 * @since 1.0.0
 *
 * @param array $attributes wp_editor arguments.
 */
$editor_args = apply_filters( 'buddypages_textarea_editor_args', array(
	'teeny' => true,
	'media_buttons' => false,
	'quicktags' => true,
	'textarea_rows' => 1,
), 'admin' );

Modify array values to change arguments

The following will make BuddyPages use the full TinyMCE UI instead of the smaller condensed version. You should put this snippet into your theme’s functions.php file or a custom plugin.

function prefix_buddypages_tinymce( $args = array() ) {
        // Makes it use the full TinyMCE instead of the PressThis condensed version.
	$args['teeny'] = false;

	return $args;
}
add_filter( 'buddypages_textarea_editor_args', 'prefix_buddypages_tinymce' );

The following will make BuddyPages add the “Add Media” button above the editor. You should put this snippet into your theme’s functions.php file or a custom plugin.

Note: Users will need a user level of author or higher to see the button shown.

function prefix_buddypages_tinymce( $args = array() ) {
	$args['media_buttons'] = true;

	return $args;
}
add_filter( 'buddypages_textarea_editor_args', 'prefix_buddypages_tinymce' );
Updated Dec 12, 2022 8:57 PM