Share Pastebin
Guest
Public paste!

ntom

By: a guest | Feb 11th, 2008 | Syntax: None | Size: 2.04 KB | Hits: 685 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. function _cat_row( $category, $level, $name_override = false ) {
  2.         global $class;
  3.  
  4.         $pad = str_repeat( '— ', $level );
  5.         if ( current_user_can( 'manage_categories' ) ) {
  6.                 $edit = "<a href="http://www.theatons.com/blog/wp-admin/categories.php?action=edit&cat_ID=$category-%3Eterm_id" class="edit">".__( 'Edit' )."</a>
  7.  
  8. ";
  9.                 $default_cat_id = (int) get_option( 'default_category' );
  10.                 $default_link_cat_id = (int) get_option( 'default_link_category' );
  11.  
  12.                 if ( $category->term_id != $default_cat_id )
  13.                         $edit .= "
  14. <a href="http://www.theatons.com/blog/wp-admin/%22%20.%20wp_nonce_url%28%20%22categories.php?action=delete&cat_ID=$category-%3Eterm_id%22,">term_id ) . "' onclick=\"return deleteSomething( 'cat', $category->term_id, '" . js_escape(sprintf( __("You are about to delete the category '%s'.nAll posts that were only assigned to this category will be assigned to the '%s' category.nAll links that were only assigned to this category will be assigned to the '%s' category.n'OK' to delete, 'Cancel' to stop." ), $category->name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
  15.                 else
  16.                         $edit .= "
  17. ".__( "Default" );
  18.         } else
  19.                 $edit = '';
  20.  
  21.         $class = ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'";
  22.  
  23.         $category->count = number_format_i18n( $category->count );
  24.         $posts_count = ( $category->count > 0 ) ? "<a href="http://www.theatons.com/blog/wp-admin/edit.php?cat=$category-%3Eterm_id">$category->count</a>" : $category->count;
  25.         $output = "
  26.  
  27. $category->term_id
  28. " . ( $name_override ? $name_override : $pad . ' ' . $category->name ) . "
  29. $category->description
  30. $posts_count
  31. $edit
  32.  
  33. nt
  34.  
  35. n";
  36.  
  37.         return apply_filters('cat_row', $output);
  38. }