Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //Dump termmeta fieldnames to the browser
- add_action( 'init' , function() {
- var_dump( get_termmeta_for_term_id( 41 ));
- } , 20, 1 );
- /**
- * get an array of termmeta fieldnames that actually exist on a termid
- * @param [type] $termid [description]
- * @return [type] [description]
- */
- function get_termmeta_for_term_id( $termid ) {
- global $wpdb;
- $result = $wpdb->get_results( "SELECT meta_key FROM {$wpdb->prefix}termmeta where term_id = {$termid};" , OBJECT );
- $result = array_map( function( $item ) { return $item->meta_key; } , $result );
- return $result;
- }
Add Comment
Please, Sign In to add comment