[wp-hackers] menu builder and categories with the same name

capsx capsx at team.lv
Tue Nov 23 11:20:50 UTC 2010


i made filter:

function top_parent_name($menu_item)
{
     $parent_cat_list = 
get_category_parents($menu_item->ID, false, ',');
     $parent_cat_list_array = split(",", 
$parent_cat_list);
     $top_parent_name = $parent_cat_list_array[0];

     if($top_parent_name=='')
         $menu_item->title = $menu_item->title;
     else
         $menu_item->title = $top_parent_name.': 
'.$menu_item->title;

     return $menu_item;
}
if(is_admin())
{
     add_filter('wp_setup_nav_menu_item', 
'top_parent_name');
}




On Mon, 22 Nov 2010 13:45:24 +0100
  "Peter van der Meij" <peter at pjvdm.nl> wrote:
> why use a parent/child relationship.
> 
> As I understand it:
> 
> cat 1
> 	cat a
> 	cat b
> 	cat c
> cat 2
> 	cat a
> 	cat b
> 	cat c
> cat 3
> 	cat a
> 	cat b
> 	cat c
> 
> is there a special reason to assign it this way?
> Why not simple cat a and cat 3. It would simplify the 
>process immensely.
> 
> 
> -----Original Message-----
>From: wp-hackers-bounces at lists.automattic.com
> [mailto:wp-hackers-bounces at lists.automattic.com] On 
>Behalf Of capsx
> Sent: maandag 22 november 2010 12:51
> To: wp-hackers at lists.automattic.com
> Subject: [wp-hackers] menu builder and categories with 
>the same name
> 
> Hi, all!
> 
> I have 3 categories, and under the each of the category 
>are subcategories
> with the same structure.
> Is there any way to display normal category tree under 
>the "Menu Builder" -
> it is impossible to see which subcategory is under which 
>category, cause
> each 3 have the same Name ...
> 
> -nonse response-
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

-nonse response-


More information about the wp-hackers mailing list