/ Published in: PHP
                    
                                        It's working now. Just having issue with it applying to all columns. Need to keep checking. (IE. have to tax's for testing, only one has the additional meta info attached, but they are both showing in the column as having the address as "active" (using same addy for both) will play more ).
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 /** * Lets manage the new column * * @ref http://wordpress.org/support/topic/custom-post-type-admin-ui-with-custom-taxonomies * @ref http://wordpress.org/support/topic/add-id-column-to-custom-taxonomy-admin-display-1 * @help http://snipplr.com/view/46538/manage-custom-taxonomy-column-meta/ (??) * @since 0.1.0 */ function manage_venues_column( $tag, $column_name ) { global $wpdb, $taxonomy, $post, $post_type; /* get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) */ $address = get_metadata( 'venues', get_venues_id_by_key( 'address' ), 'address', true ); $city = get_metadata( 'venues', get_venues_id_by_key( 'city' ), 'city', true ); $state = get_metadata( 'venues', get_venues_id_by_key( 'state' ), 'state', true ); $zip = get_metadata( 'venues', get_venues_id_by_key( 'zip' ), 'zip', true ); $gmaps = 'http://maps.google.com/maps?q='; $map_script = "<script type='text/javascript'>jQuery(document).ready( function() { jQuery('th#maps.manage-column.column-maps').css({ textAlign: 'center', width: '10%' }); jQuery('td.maps.column-maps').css({ textAlign: 'center', width: '10%' }); });</script>"; $edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $post_type ); //Not correct, need old query_var_something.... switch( $column_name ) { case 'maps' : echo $map_script . '<a href="'.$gmaps.'" target="_blank" style="color:green"><strong>√</strong></a>'; } else { echo $map_script . '<a class="nomap" href="' . $edit_link . '" style="color:red"><strong>χ</strong></a>' . var_dump( get_venues_id_by_key( 'address' ) ); } break; } } /** * Try to get the ID by way of $wpdb * * @ref http://wpseek.com/blog/2010/how-to-get-the-meta-id-by-meta-key/80/ * @since 0.1.0 */ function get_venues_id_by_key( $meta_key ) { global $wpdb; $venue = $wpdb->get_var( $wpdb->prepare( "SELECT venues_id FROM $wpdb->venuesmeta WHERE meta_key = %s", $meta_key ) ); if ( $venue != '' ) return (int)$venue; return false; }
Comments
                    Subscribe to comments
                
                