0);
if ( !empty($_GET['s']) )
$args['search'] = $_GET['s'];
$categories = get_categories( $args );
}
$children = _get_term_hierarchy('category');
if ( $categories ) {
ob_start();
foreach ( $categories as $category ) {
if ( $category->parent == $parent) {
echo "\t" . _cat_row( $category, $level );
if ( isset($children[$category->term_id]) )
cat_rows( $category->term_id, $level +1, $categories );
}
}
$output = ob_get_contents();
ob_end_clean();
$output = apply_filters('cat_rows', $output);
echo $output;
} else {
return false;
}
}
function _cat_row( $category, $level, $name_override = false ) {
global $class;
$category = get_category( $category );
$pad = str_repeat( '— ', $level );
if ( current_user_can( 'manage_categories' ) ) {
$edit = "". ( $name_override ? $name_override : $pad . ' ' . $category->name ) ." ";
$default_cat_id = (int) get_option( 'default_category' );
} else {
$edit = ( $name_override ? $name_override : $pad . ' ' . $category->name );
}
$class = " class='alternate'" == $class ? '' : " class='alternate'";
$category->count = number_format_i18n( $category->count );
$posts_count = ( $category->count > 0 ) ? "$category->count " : $category->count;
$output = "
$column_display_name) {
switch ($column_name) {
case 'cb':
?>
post_date && 'date' == $column_name ) {
$t_time = $h_time = __('Unpublished');
} else {
if ( 'modified' == $column_name ) {
$t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
$m_time = $page->post_modified;
$time = get_post_modified_time('G', true);
} else {
$t_time = get_the_time(__('Y/m/d g:i:s A'));
$m_time = $page->post_date;
$time = get_post_time('G', true);
}
if ( ( abs(time() - $time) ) < 86400 ) {
if ( ( 'future' == $page->post_status) )
$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
else
$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
} else {
$h_time = mysql2date(__('Y/m/d'), $m_time);
}
}
?>
post_status) _e(' — Private '); ?>
ID );
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
if ( $left )
echo '';
comments_number(" ', " ', " ');
if ( $left )
echo ' ';
?>
post_status ) {
case 'publish' :
case 'private' :
_e('Published');
break;
case 'future' :
_e('Scheduled');
break;
case 'pending' :
_e('Pending Review');
break;
case 'draft' :
_e('Unpublished');
break;
}
?>
post_parent == $id ) {
array_splice($children_pages, $i, 1);
display_page_row($child, $children_pages, $level+1);
$i = -1; //as numeric keys in $children_pages are not preserved after splice
}
}
}
/*
* displays pages in hierarchical order
*/
function page_rows( $pages ) {
if ( ! $pages )
$pages = get_pages( 'sort_column=menu_order' );
if ( ! $pages )
return false;
// splice pages into two parts: those without parent and those with parent
$top_level_pages = array();
$children_pages = array();
foreach ( $pages as $page ) {
// catch and repair bad pages
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
clean_page_cache( $page->ID );
}
if ( 0 == $page->post_parent )
$top_level_pages[] = $page;
else
$children_pages[] = $page;
}
foreach ( $top_level_pages as $page )
display_page_row($page, $children_pages, 0);
/*
* display the remaining children_pages which are orphans
* having orphan requires parental attention
*/
if ( count($children_pages) > 0 ) {
$empty_array = array();
foreach ( $children_pages as $orphan_page ) {
clean_page_cache( $orphan_page->ID);
display_page_row( $orphan_page, $empty_array, 0 );
}
}
}
function user_row( $user_object, $style = '', $role = '' ) {
global $wp_roles;
if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
$user_object = new WP_User( (int) $user_object );
$email = $user_object->user_email;
$url = $user_object->user_url;
$short_url = str_replace( 'http://', '', $url );
$short_url = str_replace( 'www.', '', $short_url );
if ('/' == substr( $short_url, -1 ))
$short_url = substr( $short_url, 0, -1 );
if ( strlen( $short_url ) > 35 )
$short_url = substr( $short_url, 0, 32 ).'...';
$numposts = get_usernumposts( $user_object->ID );
if ( current_user_can( 'edit_user', $user_object->ID ) ) {
$edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
$edit = "