id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 45938,Adding new term meta fails if column is wrapped in a conditional,dingo_d,,"I have created two custom taxonomies in my custom post type, and I have added one callback to render new columns in the taxonomy screen. Since the two taxonomies share one column, but don't share another I created something like this: {{{#!php taxonomy ) && ( get_current_screen() )->taxonomy === 'tax2' ) { $columns[ 'column2' ] = esc_html__( 'Column 2', 'plugin-name' ); } return $columns; } // Render content in columns add_filter( 'manage_tax1_custom_column', 'render_column_content', 10, 3 ); add_filter( 'manage_tax2_custom_column', 'render_column_content', 10, 3 ); function render_column_content( $content, $column_name, $term_id ) { switch ( $column_name ) { case... // render content from term meta } return $content; } }}} While this works, it has a strange bug that's related to the fact that the taxonomy terms are added using ajax and the added conditional check. When you create a term in the second taxonomy, the term is added but the second column is empty until you refresh the page. I haven't dug much deeper as to why this happens. I guess that the `get_current_screen()` isn't available in the ajax callback or something like this. The workaround is to create two separate functions for adding columns and duplicate the first column.",defect (bug),new,normal,Awaiting Review,Taxonomy,5.0.2,normal,,dev-feedback 2nd-opinion,,