Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update_post_meta( $company_id, 'profile_updated_on', current_time( 'timestamp', 0 ) );
- meta_key meta_value
- 1) profile_updated_on 1516763741
- 2) profile_updated_on 1516691767
- 3) profile_updated_on 1516691769
- // Add the custom columns to the organization post type:
- add_filter( 'manage_edit-organization_columns', 'set_custom_edit_organization_columns' );
- function set_custom_edit_organization_columns($columns) {
- $columns['profile_updated_on'] = __( 'Last Updated', 'cthe' );
- return $columns;
- }
- // Add the data to the custom columns for the organization post type:
- add_action( 'manage_organization_posts_custom_column' , 'custom_organization_column', 10, 2 );
- function custom_organization_column( $column_name, $post_id ) {
- if('profile_updated_on' != $column_name)
- return;
- $profile_updated_on_timestamp = get_post_meta( $post_id , 'profile_updated_on' , true );
- //echo date_i18n($profile_updated_on);
- echo get_date_from_gmt( date( 'Y-m-d ', $profile_updated_on_timestamp ), 'F j, Y' );
- }
- function your_columns_head($defaults) {
- $new = array();
- $updated_by = $defaults['profile_updated_on']; // save the tags column
- foreach($defaults as $key=>$value) {
- if($key=='date') { // when we find the date column
- $new['profile_updated_on'] = $updated_by; // put the tags column before it
- }
- $new[$key]=$value;
- }
- return $new;
- }
- add_filter('manage_organization_posts_columns', 'your_columns_head');
- function set_custom_organization_sortable_columns( $columns ) {
- $columns['profile_updated_on'] = 'profile_updated_on';
- //To make a column 'un-sortable' remove it from the array
- //unset($columns['title']);
- return $columns;
- }
- add_filter( 'manage_edit-organization_sortable_columns', 'set_custom_organization_sortable_columns' );
Add Comment
Please, Sign In to add comment