Last active
April 25, 2016 22:37
-
-
Save feliciaceballos/ddc7604663d1f838bc5917aa283d4ec4 to your computer and use it in GitHub Desktop.
Populate Custom Fields in Post List View
This file contains 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
function populate_custom_fields_in_post_list_view ($column_name, $id ) { | |
global $post; | |
$email = get_post_meta( $post->ID, 'automaton_client_email', true); | |
switch ($column_name) { | |
case 'client_email': | |
echo email_template($email); | |
break; | |
case 'client_phone': | |
echo get_post_meta( $post->ID, 'automaton_client_phone', true); | |
break; | |
default: | |
break; | |
} // end switch | |
} | |
add_action( 'manage_posts_custom_column', 'populate_custom_fields_in_post_list_view', 10, 2 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment