All Topics
Filtering third-party column
Hello,
I was wondering: is there any way to enable filtering for third-party columns?
Here is my column for the post type fiche.
function gpc_fiche_columns( $columns ) {
$columns['rubrique'] = __( 'Rubrique', 'gpc' );
return $columns;
}
add_filter( 'manage_fiche_posts_columns', 'gpc_fiche_columns' );
function gpc_fiche_column( $column, $post_id ) {
$theme = get_field( 'fiche-attachment', $post_id );
$rubrique = get_field( 'theme-attachment', $theme );
if ( $column === 'rubrique' && !empty ( $rubrique ) ) : ?>
<a href="<?= get_edit_post_link( $rubrique ); ?>">
<?= get_the_title( $rubrique ); ?>
</a>
<?php endif;
}
add_action( 'manage_fiche_posts_custom_column', 'gpc_fiche_column', 10, 2 );
Thank you.
You must be logged in to reply to this topic.