Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_videos_columns($columns)
- {
- $columns = array(
- "cb" => "<input type=\"checkbox\" />",
- "title" => "Title",
- "firstname" => "First Name",
- "lastname" => "Last Name",
- "titles" => "Title",
- "value" => "Value",
- "subject" => "Subject",
- "date" => "Date"
- );
- return $columns;
- }
- function my_custom_columns($column){
- global $post;
- switch($column){
- case "firstname":
- $custom = get_post_custom();
- echo $custom["video_firstname"][0];
- break;
- case "lastname":
- $custom = get_post_custom();
- echo $custom["video_lastname"][0];
- break;
- case "titles":
- $custom = get_post_custom();
- echo $custom["video_title"][0];
- break;
- case "value":
- // Get terms for post
- $terms = get_the_terms( $post->ID , 'Values' );
- // Loop over each item since it's an array
- foreach( $terms as $term ) {
- // Print the name method from $term which is an OBJECT
- print $term->name . '<br />';
- // Get rid of the other data stored in the object, since it's not needed
- unset($term);
- }
- break;
- case "subject":
- // Get terms for post
- $terms = get_the_terms( $post->ID , 'Subjects' );
- // Loop over each item since it's an array
- foreach( $terms as $term ) {
- // Print the name method from $term which is an OBJECT
- print $term->name . '<br />';
- // Get rid of the other data stored in the object, since it's not needed
- unset($term);
- }
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement