• If I use

    // enable compatibility with theme custom menu walkers
    add_filter('jcs/enable_public_walker', '__return_false');

    with this plugin that make a mobile menu
    Responsive menu wordpress

    I can′t use this function in populated items for take thumbnails

    
    add_filter( 'jcs/menu_item_args', 'jcs_menu_item_args', 10, 2);
    function jcs_menu_item_args($args, $item){
    
    switch($item->object){
        case 'page':
            // add blue 10 pixel image before the menu item name
            $args->link_before = '<img alt="" src="https://placehold.it/10x10/0000FF" />';
        break;
        case 'term':
            // add green 10 pixel image before the menu item name
            $args->link_before = '<img alt="" src="https://placehold.it/10x10/00FF00" />';
        break;
        case 'post':
            // add red 10 pixel image before the menu item name
            $args->link_before = '<img alt="" src="https://placehold.it/10x10/FF0000" />';
        break;
    }
    return $args;
    }
    

    There is another function or hack to make this??

    thx for your time

  • The topic ‘Put images in populated items compatibility’ is closed to new replies.