• Hi @takayukister ! Thank you for acceptng my request and adding filters flamingo_htmlize, flamingo_add_inbound and also for flamingo_add_contact though, I have not asked for ‘flamingo_add_contact’ but it is a great edition.

    But what I find is “flamingo_htmlize” is also filtering meta, what I was expecting is for only fields resulting modifications on meta instead of only to fields.

    
     function flamingo_htmlize( $val ) {
    	if ( is_array( $val ) ) {
    		$result = '';
    
    		foreach ( $val as $v ) {
    			$v = flamingo_htmlize( $v );
    			$v = apply_filters('flamingo_htmlize', $v);
    			$result .= '<li>' . $v . '</li>';
    			
    		}
    
    		return '<ul>' . $result . '</ul>';
    	}
    
    	return wpautop( esc_html( (string) $val ) );
    }

    this is what I suggested you and for me it is working as expected, Can you please give some idea how I can find similar effect with the filter you have added? Please let me know if you are writing any post on this .

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Prafulla Kumar Sahu

    (@prafulla)

    Problem with new filter is We can not change the display of field as the filter is out side “ul”, Can I think about adding another filter inside “li”, that will give user a huge power to bring modification according to their wish.

    Thread Starter Prafulla Kumar Sahu

    (@prafulla)

    It can be done with current filter, I did it with some modification and another filter to my function in my custom extension and it worked as expected.

    so,

    function flamingo_htmlize( $val ) {
    	$result = '';
    
    	if ( is_array( $val ) ) {
    		foreach ( $val as $v ) {
    			$result .= sprintf( '<li>%s</li>', flamingo_htmlize( $v ) );
    		}
    
    		$result = sprintf( '<ul>%s</ul>', $result );
    	} else {
    		$result = wpautop( esc_html( (string) $val ) );
    	}
    
    	return apply_filters( 'flamingo_htmlize', $result, $val );
    }

    is 100% correct.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue regarding new flamingo_htmlize filter’ is closed to new replies.