Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
Use this filter to modify the final result of a View.
Parameters
- $content: a string
- $args: an array containing two booleans.
- $context['is_detail_page']
- $context['is_shortcode']
Examples
Remove all images from the listing View
add_filter( 'frm_filter_final_view', function( $content, $args ) {
$view = $args['view'];
$context = $args['context'];
if ( $view->ID == 10 && empty( $context['is_detail_page'] ) && empty( $context['is_shortcode'] ) ) {
$content = preg_replace( '/<(s*)img[^<>]*>/i', '', $content );
}
return $content;
}, 10, 2 );