Created
November 24, 2021 23:12
-
-
Save ahmadthedev/a91b40bc80d504acfd7099cd56aad7b0 to your computer and use it in GitHub Desktop.
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 | |
// Display County (Custom Taxonomy) in States (Custom Taxonomy) - Add New Taxonomy Admin Column | |
add_filter( 'manage_edit-states_columns', 'wpdocs_add_new_states_columns', 10 ); | |
function wpdocs_add_new_states_columns( $columns ) { | |
$columns['county'] = __( 'County' ); | |
return $columns; | |
} | |
add_action( 'manage_states_custom_column', 'wpdocs_show_states_meta_info_in_columns', 10, 3 ); | |
function wpdocs_show_states_meta_info_in_columns( $string, $columns, $term_id ) { | |
switch ( $columns ) { | |
case 'county' : | |
$t_id = esc_html( get_term_meta( $term_id, 'select_county_states', true ) ); | |
echo get_term( $t_id )->name; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment