Hooks & Filter

Filr provides a lot of useful filters and actions to modify the plugin’s behavior. This docs section is dedicated to developers, so expect a lot of code to read.

Action Hooks

filr_frontend_file_uploaded

This action gets executed each time a file was uploaded with the frontend uploader. This can be useful to include custom notifications, sending e-mails, or triggering other actions after the upload.

add_action('filr_frontend_file_uploaded', function( $file_id) {
// Trigger something.
});

filr_custom_column

This action can be used to include custom column content into Filr libraries. This can be useful if you already included a custom column and you want to show information like ACF fields or other data per file here.

add_action( 'filr_custom_column', function ( $td, $file_id ) {
	?>
	<?php if ( 'custom' == $td ): ?>
        <td class="custom">
			<?php echo $file_id; ?>
        </td>
	<?php endif; ?>
	<?php
}, 10, 2 );

Filter Hooks

filr_header_columns

This filter can be used to add additional columns into Filr libraries. Make sure to include those columns in Filr > Settings > Libraries > Sort your columns to make them visible in the front end.

add_filter( 'filr_header_columns', function ( $header_columns ) {
	$header_columns['custom'] = array(
		'title' => 'Custom',
		'hide'  => 'off',
	);
} );