Last active
May 25, 2022 12:41
-
-
Save patrickposner/675cf687c4f94543ef458ef749b698e5 to your computer and use it in GitHub Desktop.
Add custom columns to FILR libraries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure you add the newly registered header column in FILR -> Settings -> Sort your columns.