Parent Message Never Hidden


Home Forums Front End PM PRO Parent Message Never Hidden

This topic is: Not Resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30087
    David
    Participant

    Hi Shamim,
    Would it be possible to have the parent message always showing regardless of having been read or the action of the toggle messages button.
    I want replies to be hidden after being read and the toggle messages button to show/hide replies but not the parent message.
    Thanks for your help

    #30092
    shamim
    Keymaster

    You can override view-message-content.php template to manually remove that class from parent message. Currently there is no direct hook to achieve this. Next version i will try to add hook to achieve this easily.

    #30094
    David
    Participant

    Hi,
    Thanks for the info. I am afraid I am not sure how to do that for the parent message only.
    Any help is appreciated otherwise I will wait for the next version.

    #30098
    shamim
    Keymaster

    You can make changes from this commit https://github.com/shamim2883/front-end-pm/commit/606a4b8bc1ea987721cf13c409f64cf46face71d

    Then add following code in your theme’s (child theme’s if you are using) functions.php

    add_filter( 'fep_sanitize_html_class', function( $classes ) {
    	if ( fep_get_the_id() && ! fep_get_message_field( 'mgs_parent' ) ) {
    		$classes = str_replace( [ 'fep-message-content', 'fep-hide-if-js' ], '', $classes );
    	}
    	return $classes;
    });
    
    #30112
    David
    Participant

    Many thanks, was the ‘fep-message-content’ there for any particular reason? I removed it and it still works ok, if I leave it in I lose some custom css applied to that class.

    #30127
    shamim
    Keymaster

    if that class removed then if you click toggle button, it will toggle.

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

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.