'view_eot' == $vars['orderby']
'EOT' == $vars['orderby']
Statistics: Posted by pcscweb — September 22nd, 2011, 7:23 pm
Statistics: Posted by bitofgrace — September 21st, 2011, 12:36 pm
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 11, 3);
function add_eot_column ($eot_column)
{
$eot_column['view_eot'] = 'EOT';
return $eot_column;
}
function view_eot_column ($eot_column, $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
$eot_column = date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
}
return $eot_column;
}
function eot_sortable_columns ($columns)
{
$columns['view_eot'] = 'EOT';
return $columns;
}
add_filter ('manage_users_sortable_columns', 'eot_sortable_columns');
function eot_column_orderby ($vars)
{
if (isset ($vars['orderby']) && 'view_eot' == $vars['orderby'])
{
$vars = array_merge ($vars, array ('meta_key' => 'view_eot', 'orderby' => 'meta_value', 'order' => 'asc'));
}
return $vars;
}
add_filter ('request', 'eot_column_orderby');
Statistics: Posted by Bruce C — September 21st, 2011, 11:18 am
redliontrader wrote:
Would be even better if it were a sortable column.
Statistics: Posted by pcscweb — September 19th, 2011, 8:00 pm
Statistics: Posted by Cristián Lávaque — September 14th, 2011, 2:39 am
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 11, 3);
function add_eot_column ($eot_column)
{
$eot_column['view_eot'] = 'EOT';
return $eot_column;
}
function view_eot_column ($eot_column, $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
$eot_column = date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
}
return $eot_column;
}
Statistics: Posted by Bruce C — September 10th, 2011, 8:10 pm
Statistics: Posted by redliontrader — September 10th, 2011, 8:39 am
<?php
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 10, 3);
function add_eot_column ($columns)
{
$columns['view_eot'] = 'EOT';
return $columns;
}
function view_eot_column ($empty = '', $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
return date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
else
{
return "No EOT Set";
}
}
}
?>
Statistics: Posted by Bruce C — September 4th, 2011, 4:45 pm
<?php
//Two main filters,
add_filter('manage_users_columns', 'add_eot_column');
add_filter('manage_users_custom_column', 'view_eot_column', 10, 3);
function add_eot_column($columns) {
$columns['current_eot'] = 'EOT';
return $columns;
}
function view_eot_column($empty='', $column_name, $id) {
if( $column_name == 'current_eot' ) {
//The return below is what is shown.
return ;
}
}
?>
Statistics: Posted by Bruce C — September 4th, 2011, 3:55 pm
Statistics: Posted by redliontrader — September 4th, 2011, 12:45 pm