Skip to:
Content
Pages
Categories
Search
Top
Bottom

Activity Post With Links Starts Getting Scrambled or Cut Off


  • 1joshua
    Participant

    @1joshua

    When I first load the page and write in the text area of the Activity Stream for the post it post correctly, but after a while and if I post text with a link from youtube for example, when I hit the “post update” button the link and parts of the text will be removed after it post.

    So if I type “Hello World this is a test. youtube.com/blahblah” Then it may only show up as “Hello World” when its posted. Sometimes it post the way its supposed to, like when I first load the page. But after I post other things on the page and then maybe go to post something with a link the trouble begins.

    After the post begins getting cut off like that, I can post a single comma or period in the text box and then hit “Post Update” and instead of posting the comma or period it will post older text I am not currently posting… for example like that “Hello World” with the rest of the text and the link redacted or not present.

    Any ideas what could be causing this and has anyone seen this behavior before in the Activity Stream Post?

Viewing 6 replies - 1 through 6 (of 6 total)

  • Venutius
    Moderator

    @venutius

    I think this is because every new activity item is going through the wp_kses filter and if those elements are not in the allowed list they will be stripped. There’s a filter yu can use to allow these extra elements. I’ve an example below showing how to allow paragraph tags:

    function venutius_activity_allowed_tags( $allowed_tags ) {
    
    	return array_merge_recursive( $allowed_tags, array(
    		'p'	 => array(),
    	) );
    }

    add_filter( ‘bp_activity_allowed_tags’, ‘venutius_activity_allowed_tags’ );’


    1joshua
    Participant

    @1joshua

    Thank you for getting back to my post. I’m not sure what it is but if I post in the Activity Stream and type text like I’m typing right now, when I hit the “Post Update” button the text might look like what I typed below this in quotations.

    “Thank you for getting back t”

    I tried the code you have above but it didn’t seem to make a difference.


    Venutius
    Moderator

    @venutius

    Ah sorry, that’s not the problem I thought you were reporting. Have you tried deactivating all other plugins and testing? It sounds like something is interfering with the JavaScript that adds the activity update. Also check the JS Console for errors (right click on the page, inspect and then select console to see any js errors reported).


    1joshua
    Participant

    @1joshua

    I am getting this error in the js Console “?v=2.0:6 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403”

    I’m not sure what it means or if this would be causing it but I did get that error above. I think I tried disabling plugins also.


    Venutius
    Moderator

    @venutius

    This indicates you are using wordpress.com, we don’t offer support for that here, they have their own support forums and that specific error would need to be raised wit them.


    1joshua
    Participant

    @1joshua

    Ok thank you very much, I am going to post this in their forum today.

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