Skip to:
Content
Pages
Categories
Search
Top
Bottom

Whats new tinymce not showing HTML inline styles

  • @hiteshmakvana

    Participant

    I have added inline style in my html tags but it is removed in whats new textarea after posting data .I want to show inline style on whats new section
    This is my site
    http://hitesh.wpengine.com/

Viewing 12 replies - 1 through 12 (of 12 total)
  • @henrywright

    Moderator

    The link you posted takes me to a login page?

    @danbp

    Participant

    Do you mean html <style> tag or inline css style ?

    The form is texturized and use wp_kses filter. To allow some html tags (at your own risk), you can use such a function:(in bp-custom or child theme functions.php)

    function bpfr_notice_allowed_tags( $activity_allowedtags ) {
    
    		$activity_allowedtags['p']		= array();
    		$activity_allowedtags['strong']		= array();	
    		$activity_allowedtags['s']		= array();	
    
    	return $activity_allowedtags;	
    }
    add_filter( 'bp_activity_allowed_tags', 'bpfr_notice_allowed_tags' );

    @hiteshmakvana

    Participant

    I have already did above code not working……………

    I mean when i add <p style=”color:#f8f8f8″>Hello this text in while </p>

    Above style removed when showing in front-end.

    @danbp

    Participant

    You can’t add inline css. But if you add <p> or <span> tags in the textarea, you can style them via your child theme css. Something like textarea#whats-new p {color:#f8f8f8}

    And are you sure all members know how to write styles or html tags ?

    @hiteshmakvana

    Participant

    I am using tinymce on whats new textarea…
    But style are not showing which is added by tinymce bold it stong tag is working but color not working ….

    @hiteshmakvana

    Participant

    I am using tinymce but few tools which is formmatting text using inline style is not working …
    Now you getting me ?

    @danbp

    Participant

    And how did you add tinymce ?

    If you use a plugin, indicate at least his name, or publish the code you use. Also, if you use the hack i indicated here some times ago, it works only partialy.
    Also, there is a reason why BP comes without an editor for notices.
    To understand, check the editor code when you’re on the post editor in admin. You will see a lot of classes and id’s related to tiny’s tools. And these css are not included in the notice JS and the textarea of BP’s notice form.

    @hiteshmakvana

    Participant

    I have done code from this and add few js for saving data form tinymce on change event it will save to textarea.
    https://buddypress.org/support/topic/add-tinymce-to-activity-post-form/

    Now what i need is i want to store those inline css code ex. style =”color:#02251″ inside every html tag.
    But what’s new activity not storing or showing in frontend after saving data…

    @danbp

    Participant

    I have nothing to add to what i wrote previously.
    Study wp_kses function and see bp_activity_filters.php and try to deactivate the one or other filter.
    You may also read through bp-xprofiles-filters.php to see how wp_editor is handled for xprofile fields using rich edit.

    All this at your own risk, you have to know what you do by removing those filters, as it will open a big security hole in your site.

    @hiteshmakvana

    Participant

    i know this is risk but i really want this so can you provide me the link of one filter so i can get idea how to deal with that filter..
    I mean please send me few links so i can change that i want…
    Thank you for you help

    @danbp

    Participant

    Open the file i indicated and read through. BP code is documented and WP and BP codex can be searched. I can’t do that at your place, sorry.

    @hiteshmakvana

    Participant

    Ok thank you i will find it …
    Thanks lot you saved my time

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar