Skip to:
Content
Pages
Categories
Search
Top
Bottom

Rich text editor not showing media upload button with post form.


  • aman0907
    Participant

    @aman0907

    This is my code. It showing media upload button for admin not for user.

    
    function bpfr_whats_new_tiny_editor() {
    	// deactivation of the visual tab, so user can't play with template styles
    add_filter ( 'user_can_richedit' , create_function ( '$a' , 'return false;' ) , 50 );
    
    	// building the what's new textarea
    	if ( isset( $_GET['r'] ) ) :
    	$content = esc_textarea( $_GET['r'] ); 
    	endif;
    
    	// adding tinymce tools
    	$editor_id = 'whats-new';
    		$settings = array( 
    		'textarea_name' => 'whats-new', 
    		'teeny' => true, 
    		'media_buttons' => true, 
    		'drag_drop_upload' => true, 
    		'quicktags' => array(
    		'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'));	
    	
    	// get the editor	
    	
    	
    	wp_editor( $content, $editor_id, $settings );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );
  • You must be logged in to reply to this topic.
Skip to toolbar