Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Last active May 25, 2022 12:41
Show Gist options
  • Save patrickposner/675cf687c4f94543ef458ef749b698e5 to your computer and use it in GitHub Desktop.
Save patrickposner/675cf687c4f94543ef458ef749b698e5 to your computer and use it in GitHub Desktop.
Add custom columns to FILR libraries
<?php
add_filter( 'filr_header_columns', function( $columns ) {
$columns['custom'] = array(
'title' => esc_html__( 'Custom', 'filr' ),
'hide' => 'off',
);
return $columns;
});
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 );
@patrickposner
Copy link
Author

Make sure you add the newly registered header column in FILR -> Settings -> Sort your columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment