Skip to:
Content
Pages
Categories
Search
Top
Bottom

Rich text editor, tinymceditor in Message Compose?

  • @jessy-marco

    Participant

    Paste this into members/single as index-action-compose.php

    <?php get_header(); ?>
    
    <form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" enctype="multipart/form-data">
    
    	<?php
    
    	/**
    	 * Fires before the display of message compose content.
    	 *
    	 * @since BuddyPress (1.1.0)
    	 */
    	do_action( 'bp_before_messages_compose_content' ); ?>
    
    	<label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress' ); ?></label>
    	<ul class="first acfb-holder">
    		<li>
    			<?php bp_message_get_recipient_tabs(); ?>
    			<input type="text" name="send-to-input" class="send-to-input" id="send-to-input" />
    		</li>
    	</ul>
    
    	<?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?>
    		<input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?>
    	<?php endif; ?>
    
    	<label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
    	<input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" />
    
    	<label for="content"><?php _e( 'Message', 'buddypress' ); ?></label>
    	<!-- <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea> -->
    	<?php 
    
    	$editor_settings = array(
    		'content' => bp_messages_content_value(),
    		'textarea_name' => 'content',
    		'editor_id' => 'message_content',
    	);
    	wp_editor( bp_messages_content_value(), "message_content", $editor_settings); ?>
    
    	<input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
    
    	<?php
    
    	/**
    	 * Fires after the display of message compose content.
    	 *
    	 * @since BuddyPress (1.1.0)
    	 */
    	do_action( 'bp_after_messages_compose_content' ); ?>
    
    	<div class="submit">
    		<input type="submit" value="<?php esc_attr_e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
    	</div>
    
    	<?php wp_nonce_field( 'messages_send_message' ); ?>
    </form>
    
    <script type="text/javascript">
    	document.getElementById("send-to-input").focus();
    </script>
    
    <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • @danbp

    Participant

    Thank you for sharing.

    @jessy-marco

    Participant

    in post form we need to customize budypress.js because after sumbmision it generate textarea. Any idea how?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rich text editor, tinymceditor in Message Compose?’ is closed to new replies.
Skip to toolbar